-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathinit.js
More file actions
29 lines (22 loc) · 812 Bytes
/
init.js
File metadata and controls
29 lines (22 loc) · 812 Bytes
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
import * as Sentry from '@sentry/browser';
import { createClient } from '@supabase/supabase-js';
window.Sentry = Sentry;
const supabaseClient = createClient('https://test.supabase.co', 'test-key');
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
integrations: [Sentry.browserTracingIntegration(), Sentry.supabaseIntegration({ supabaseClient })],
tracesSampleRate: 1.0,
sendDefaultPii: true,
});
// Simulate database operations
async function performDatabaseOperations() {
try {
await supabaseClient.from('todos').insert([{ title: 'Test Todo' }]);
await supabaseClient.from('todos').select('*');
// Trigger an error to capture the breadcrumbs
throw new Error('Test Error');
} catch (error) {
Sentry.captureException(error);
}
}
performDatabaseOperations();