| 23 | |
| 24 | /** Get the default integrations for the Cloudflare SDK. */ |
| 25 | export function getDefaultIntegrations(options: CloudflareOptions): Integration[] { |
| 26 | // TODO(v11): Drop this transitional gating and let `requestDataIntegration` rely on the resolved |
| 27 | // `dataCollection` defaults directly. Until then, preserve the historical Cloudflare behavior of not |
| 28 | // attaching cookies unless the user explicitly opts in via `sendDefaultPii` or `dataCollection.cookies`. |
| 29 | // eslint-disable-next-line typescript/no-deprecated |
| 30 | const cookiesEnabled = options.sendDefaultPii || options.dataCollection?.cookies != null; |
| 31 | return [ |
| 32 | // The Dedupe integration should not be used in workflows because we want to |
| 33 | // capture all step failures, even if they are the same error. |
| 34 | ...(options.enableDedupe === false ? [] : [dedupeIntegration()]), |
| 35 | // TODO(v11): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration` |
| 36 | // eslint-disable-next-line typescript/no-deprecated |
| 37 | inboundFiltersIntegration(), |
| 38 | functionToStringIntegration(), |
| 39 | conversationIdIntegration(), |
| 40 | linkedErrorsIntegration(), |
| 41 | fetchIntegration(), |
| 42 | // eslint-disable-next-line typescript/no-deprecated |
| 43 | honoIntegration(), |
| 44 | httpServerIntegration(), |
| 45 | requestDataIntegration(cookiesEnabled ? undefined : { include: { cookies: false } }), |
| 46 | consoleIntegration(), |
| 47 | ]; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Initializes the cloudflare SDK. |