![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Toucan is a Sentry client for Cloudflare Workers written in TypeScript.
fetch
and scheduled
Workers, their .mjs
equivalents, and Durable Objects
.This SDK provides all options and methods of Hub and additionally:
Option | Type | Description |
---|---|---|
context | Context | This can be any object that contains waitUntil. It can be FetchEvent, ScheduledEvent, DurableObjectState, or .mjs context. |
request | Request | If set, the SDK will send information about incoming requests to Sentry. By default, only the request method and request origin + pathname are sent. If you want to include more data, you need to use requestDataOptions option. |
requestDataOptions | RequestDataOptions | Object containing allowlist for specific parts of request. Refer to sensitive data section below. |
On top of base transportOptions
you can pass additional configuration:
Option | Type | Description |
---|---|---|
headers | Record<string, string> | Custom headers passed to fetch. |
fetcher | typeof fetch | Custom fetch function. This can be useful for tests or when the global fetch used by toucan-js doesn't satisfy your use-cases. Note that custom fetcher must conform to fetch interface. |
Toucan.setEnabled(enabled: boolean): void
: Can be used to disable and again enable the SDK later in your code.Toucan.setRequestBody(body: unknown): void
: Attaches request body to future events. body
can be anything serializable.You can use custom integrations to enhance toucan-js
as you would any other Sentry SDK. Some integrations are provided in @sentry/integrations package, and you can also write your own! To ensure an integration will work properly in toucan-js
, it must:
getCurrentHub
from @sentry/core
.console.log
).window
object, etc...).Supported integrations from @sentry/integrations are re-exported from toucan-js
:
toucan-js
also provides 2 integrations that are enabled by default, but are provided if you need to reconfigure them:
import { Toucan } from 'toucan-js';
import { RewriteFrames } from '@sentry/integrations';
type Env = {
SENTRY_DSN: string;
};
export default {
async fetch(request, env, context): Promise<Response> {
const sentry = new Toucan({
dsn: env.SENTRY_DSN,
context,
request,
integrations: [new RewriteFrames({ root: '/' })],
});
...
},
} as ExportedHandler<Env>;
By default, Toucan does not send any request data that might contain PII (Personally Identifiable Information) to Sentry.
This includes:
CF-Connecting-Ip
header)You will need to explicitly allow these data using:
allowedHeaders
option (array of headers or Regex or boolean)allowedCookies
option (array of cookies or Regex or boolean)allowedSearchParams
option (array of search params or Regex or boolean)allowedIps
option (array of search params or Regex or boolean)These options are available on RequestData integration or requestDataOptions
option (which is passed down to RequestData automatically).
FAQs
Cloudflare Workers client for Sentry
The npm package toucan-js receives a total of 73,335 weekly downloads. As such, toucan-js popularity was classified as popular.
We found that toucan-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.