Before you start
You need a FaultLens workspace, a project API key, and the correct ingest host for your tenant or validation environment.
The SDKs are intended to capture application errors and diagnostics context without interrupting the host application flow.
- Use the tenant ingest host provided for your workspace.
- The beta browser SDK sends events to POST /api/events/ingest.
- Sensitive query-string values are redacted before sending.
Example
Use this as a starting point and adjust environment, release, endpoint, and project identifiers for your workspace.
npm install @faultlenshq/browser@beta
import { FaultLens } from '@faultlenshq/browser';
const faultLens = new FaultLens({
apiKey: 'YOUR_FAULTLENS_API_KEY',
projectId: 'YOUR_PROJECT_ID',
environment: 'production',
endpoint: 'https://TENANT-SLUG.staging.faultlens.in',
release: 'web@1.0.0',
platform: 'browser'
});
faultLens.captureError(new Error('Example browser error'));
Related setup
These pages explain adjacent setup work that makes production diagnosis more useful after events start arriving.