-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathinit.js
38 lines (31 loc) · 806 Bytes
/
init.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import * as Sentry from '@sentry/browser';
import { createClient } from '@supabase/supabase-js';
window.Sentry = Sentry;
const supabase = createClient(
'https://test.supabase.co',
'test-key'
);
Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [
Sentry.browserTracingIntegration(),
Sentry.supabaseIntegration(supabase)
],
tracesSampleRate: 1.0,
});
// Simulate database operations
async function performDatabaseOperations() {
try {
await supabase
.from('todos')
.insert([{ title: 'Test Todo' }]);
await supabase
.from('todos')
.select('*');
// Trigger an error to capture the breadcrumbs
throw new Error('Test Error');
} catch (error) {
Sentry.captureException(error);
}
}
performDatabaseOperations();