Skip to content

Instantly share code, notes, and snippets.

View JFGHT's full-sized avatar
🚀
Conquering the void.

JFGHT

🚀
Conquering the void.
View GitHub Profile
@zanona
zanona / sentry-serverless-firebase.ts
Last active June 8, 2024 21:11
Missing Sentry's firebase serverless wrappers
/**
* Temporary wrapper for firebase functions until @sentry/serverless support is implemented
* It currently supports wrapping https, pubsub and firestore handlers.
* usage: https.onRequest(wrap((req, res) => {...}))
*/
import type {Event} from '@sentry/types';
import type {https} from 'firebase-functions';
import type {onRequest, onCall} from 'firebase-functions/lib/providers/https';
import type {ScheduleBuilder} from 'firebase-functions/lib/providers/pubsub';
import type {DocumentBuilder} from 'firebase-functions/lib/providers/firestore';