@symbo.ls/analyzing
v3.14.781
Published
Browser-side observability SDK for DOMQL apps — pipes @symbo.ls/analyze events (errors, console, network, perf, lifecycle, state) to the analyzed worker. Faro-compatible manual API (captureError / captureMessage / identify / setContext / addMeasurement).
Downloads
1,359
Maintainers
Keywords
Readme
@symbo.ls/analyzing
Browser-side observability SDK for DOMQL / smbls apps. Streams everything the
@symbo.ls/analyze plugin captures — errors,
console output, network calls, performance, navigation, lifecycle, state — to
the analyzed worker, which persists into
Supabase and exposes it for AI-driven session analysis.
Replaces Grafana Faro for symbo.ls apps. Faro-compatible manual API:
captureError, captureMessage, identify, setContext, addMeasurement.
Usage
import { create } from 'smbls'
import { createAnalyzing } from '@symbo.ls/analyzing'
const analyzing = createAnalyzing({
endpoint: 'https://analyzed.symbo.ls/v1/ingest',
appKey: 'workspace',
tenantKey: 'symbols-app',
release: process.env.BUILD_SHA,
env: 'production',
// Auth — pick one:
sdk, // pulls bearer from sdk.tokenManager
// apiKey: 'sk_…', // X-Analyze-Key header
// getAuth: () => fetchToken(), // custom resolver
level: 'info',
sampleRate: 1,
redact: [/password/i, /token/i],
beforeSend: (envelope) => envelope // scrub or drop
})
create(app, {
plugins: [analyzing.plugin],
analyze: analyzing.config
})
// Manual API
analyzing.identify({ userId: 'u_123', traits: { plan: 'pro' } })
analyzing.setContext('feature_flag', 'new-onboarding')
analyzing.setTag('build', 'canary')
try {
doSomething()
} catch (err) {
analyzing.captureError(err, { route: '/onboarding' })
}
analyzing.captureMessage('Checkout started', 'info', { cart: 3 })
analyzing.addMeasurement('checkout.tti', 920, 'ms')What gets captured
By default, the remote preset enables:
| Category | Notes |
|-------------|-------------------------------------------------------------------------|
| errors | window.onerror, unhandledrejection, DOMQL lifecycle throws |
| warnings | console.warn + sentinel framework warnings |
| console | log / warn / error / debug — args safely stringified |
| performance | LCP, CLS, longtask, paint, first-input, custom measurements |
| navigation | router transitions |
| viewport | resize, orientationchange, visibilitychange |
Opt in via capture: { … } overrides. Sensitive categories (pointer,
keyboard, forms, scroll) stay off in the remote preset by design.
Network capture (window.fetch + XMLHttpRequest + smbls fetch plugin
events) is off by default — the analyzed server discards un-opted-in
logType='network' envelopes at ingest (server cd64446f), so shipping them
was wasted client CPU + egress. Re-enable with the same levers the server
honors: debug: true (restores traces end-to-end — every envelope stamps
app.debug, the server's per-envelope opt-in) or capture: { network: true }
/ runtime setNetworkCapture(true) (the client half of the per-workspace
Organization.settings.analyzedNetworkCapture opt-in).
Log type classification
Every event is tagged with log_type ∈ bug | network | log | verbose before
shipping. The server re-runs the classifier on ingest (never trust the client)
but the client hint lets dashboards stream a single column without joins.
| Rule | log_type |
|--------------------------------------------|-----------|
| level === 'error' or type === 'error' | bug |
| type === 'network' | network |
| type === 'console' + level ≥ warn | bug |
| type === 'console' + level ≤ info | log |
| level === 'warn' | bug |
| level === 'info' | log |
| else (debug, trace, lifecycle, state, …) | verbose |
