@sentry/wizard
Version:
Sentry wizard helping you to configure your project
34 lines (33 loc) • 845 B
TypeScript
/**
* Wraps a Cloudflare Worker's default export with Sentry.withSentry()
*
* Before:
* ```
* export default {
* async fetch(request, env, ctx) { ... }
* } satisfies ExportedHandler<Env>;
* ```
*
* After:
* ```
* import * as Sentry from '@sentry/cloudflare';
*
* export default Sentry.withSentry(
* (env) => ({
* dsn: 'your-dsn',
* tracesSampleRate: 1,
* }),
* {
* async fetch(request, env, ctx) { ... }
* } satisfies ExportedHandler<Env>
* );
* ```
*
* @param workerFilePath - Path to the worker file to wrap
* @param dsn - Sentry DSN for initialization
* @param selectedFeatures - Feature flags for optional Sentry features
*/
export declare function wrapWorkerWithSentry(workerFilePath: string, dsn: string, selectedFeatures: {
performance: boolean;
logs: boolean;
}): Promise<void>;