API client for sanitizing and sending errors to Sentry.io
npm install @exodus/sentry-clientAPI client for sanitizing and sending errors to Sentry.io.
``js
import createSentryClient from '@exodus/sentry-client'
import { safeString } from '@exodus/safe-string'
const client = createSentryClient({
fetchival,
config: {
// get this from your sentry project page at https://xxxxxx.sentry.io/settings/projects/node/keys/
// strip the project ID url path from the url they provide
dsnUrl: 'https://
publicKey: '
projectId: '
environment: 'staging',
// optional
os: 'ios',
osVersion: '1.2.3',
platform: 'test',
appVersion: '3.2.1',
jsEngine: 'hermes', // or 'jsc'
},
})
// Note: all error messages must be safe for logging and should never expose sensitive data.
// Use the safeString tag to sanitize any dynamic values (e.g., PII, secrets etc.).Failed to send recovery email: ${email}
client.captureError({
// Will be sanitized to: "Failed to send recovery email:
error: new Error(safeString),``
})