Skip to content
LogoLogo

Sentry

@picked/sentry sends the errors of the Picked client to Sentry, and adds Picked tags to the Sentry scope.

import * as Sentry from '@sentry/browser'
import { createClient } from 'picked'
import { sentryPlugin } from '@picked/sentry'
 
Sentry.init({ dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' })
 
const client = createClient({
  projectId: 'your-project-id',
  plugins: [sentryPlugin()],
})

The plugin has no options. It uses the global Sentry scope of your application.

Requirements

Peer dependencyVersion
@sentry/browser^10
@picked/clientThe version of your Picked SDK

All the Sentry packages in your application must have the same version, for example 10.x. A different version makes a different Sentry scope, and the plugin then sends nothing.

Events

Client eventSentry result
exception with level: 'info'captureMessage, with the tag picked: true.
exception with a different levelcaptureException, with the tag picked: true.
sessionThe tag picked.id, with the Picked ID of the visitor as its value.
feature_decideThe tag picked.feature.<feature ID>, with the bucket of the feature as its value.
user_decideThe tag picked.is_user, with the result of the condition of the client as its value: true or false.

The plugin does nothing outside a browser.