Sentry integration
Skill Ampli-Group/agentic-mobile-blueprint/.agents/skills/sentry-integration
Add Sentry error tracking to Supabase Edge Functions. Use when creating functions that need error monitoring.From its SKILL.md
npx -y skills add Ampli-Group/agentic-mobile-blueprint --skill sentry-integrationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- reads credentialsReads from 1 credential source: `SENTRY_DSN`.
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.3 KB, 539 tokens by cl100k_base, as published. Nobody here has run it
Sentry Integration for Supabase Edge Functions
Helpers Available
Module _shared/sentry.ts provides:
initSentry()- Initialize (call once)handleError()- Capture errors automaticallysetSentryUser()- Track user (optional)addBreadcrumb()- Track flow (optional)
Usage
Basic Pattern
import { initSentry, handleError } from '../_shared/sentry.ts';
initSentry();
Deno.serve(async (req: Request) => {
if (req.method === 'OPTIONS') {
return new Response('ok', { headers: corsHeaders });
}
try {
const result = await processData();
return new Response(JSON.stringify({ success: true }));
} catch (error) {
return handleError(error, { functionName: 'my-function', corsHeaders });
}
});
With User Context
import { initSentry, setSentryUser, handleError } from '../_shared/sentry.ts';
import { authenticate } from '../_shared/auth.ts';
initSentry();
Deno.serve(async (req: Request) => {
try {
const { user } = await authenticate(req);
setSentryUser(user.id, user.email);
// Your logic
return new Response(JSON.stringify({ success: true }));
} catch (error) {
return handleError(error, { functionName: 'auth-function', corsHeaders });
}
});
With Breadcrumbs
import { initSentry, addBreadcrumb, handleError } from '../_shared/sentry.ts';
initSentry();
try {
addBreadcrumb('Started processing');
const result = await process();
addBreadcrumb('Completed', { count: result.length });
} catch (error) {
return handleError(error, { functionName: 'processor', corsHeaders });
}
Setup
-
Set SENTRY_DSN in
.env.local:SENTRY_DSN=https://[email protected]/123456 -
Module exists at
supabase/functions/_shared/sentry.ts(already created)
What Gets Captured
✅ Error message and stack trace
✅ Function name (tagged)
✅ Request details
✅ User context (if set)
✅ Breadcrumbs (if added)
❌ Authorization headers (auto-removed)
Testing
throw new Error('Test error for Sentry');
Check Sentry dashboard for the error with full context.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.