Skip to content

SDKs

How your app sends data to Sypnia. One SDK for the browser, one for Node, one for Next.js, a bridge for apps that already use OpenTelemetry, and the OTLP intake for every other backend.

Applies to EngineCloud
View as Markdown
On this page
  1. Which one you need
  2. Own SDKs, a standard wire
  3. The whole public API
  4. Pages in this section

An SDK is the small piece of Sypnia that lives inside your app. It notices what happens (an error, a slow page, a click that does nothing) and sends it to Sypnia as events.

The SDKs are open source, under the MIT licence (decided 2026-11-17: see Licensing), and are the same for the open-source engine and for Sypnia Cloud. Two things differ, and every page shows both:

Sypnia CloudSelf-hosted engine
Where the SDK sendshttps://ingest.sypnia.com, the default (also answers at https://telemetry.ingest.sypnia.com). You set nothing.Your engine’s base URL, in the option endpoint.
Where the key comes fromYour project’s page in telemetry.app.sypnia.com.sypnia project create, or the API.

npm

npm install @sypnia/telemetry
import { init } from '@sypnia/telemetry/browser';

init({ project: 'YOUR_PROJECT_KEY' });

Full quickstart

Which one you need

Your appUse
Anything that runs in a browser: React, Vue, Svelte, plain HTML, an app made with an AI builder@sypnia/telemetry/browser
A Next.js app@sypnia/telemetry/next, which covers the browser and the server
A Node server: Express, Fastify, Koa, NestJS, Hono@sypnia/telemetry/node
A backend in Python, Go, PHP, Rust, Java or anything elseOpenTelemetry: point your OTLP exporter at Sypnia
A mobile app built as a web view@sypnia/telemetry/browser
A native iOS or Android appThere is no native Sypnia SDK: send traces with OpenTelemetry’s SDK for your language, and use the browser SDK in web views. See Limits.

A web app with its own backend uses two: the browser SDK in the page and a server SDK (or OpenTelemetry) in the backend, both sending to the same project. That is what lets Sypnia follow one click from the page to the database.

Node or Next.js backendUse
No OpenTelemetry today@sypnia/telemetry/node or @sypnia/telemetry/next
OpenTelemetry already registered, or you need its instrumentations (Prisma, MySQL, MongoDB, Redis)@sypnia/telemetry/otel, the bridge, at OpenTelemetry’s cost

Own SDKs, a standard wire

Sypnia’s SDKs are its own, and light on purpose: none of them depends on OpenTelemetry. On the wire they split by what OpenTelemetry has a standard for:

SendsTo
Browser SDKSypnia’s compact events: sessions, replay, clicks, rage and dead clicks, vitals with their element. OpenTelemetry has no standard for these. It also sends the W3C traceparent header on calls to your API/v1/ingest/events
Server SDKs (Node, Next.js) and the bridgeTraces in the OpenTelemetry protocol, OTLP/HTTP in protobuf, with OpenTelemetry’s attribute names and a few sypnia.* ones: the semantic conventions/v1/otlp/v1/traces
Any OpenTelemetry exporter, any languageThe same OTLP traces/v1/otlp/v1/traces

Why not OpenTelemetry inside the SDKs: we measured it. On one Node server, the official OpenTelemetry SDK added three to five times as much CPU per request as a light tracer of our own, and 600–800 ms to startup (measured on 2026-11-15: the numbers and the method). Why OTLP on the wire: so a server’s traces are readable by any tool, and so any language can send them.

The whole public API

The three main packages, a handful of functions. The bridge’s two functions are on its page.

Function@sypnia/telemetry/browser@sypnia/telemetry/nodeWhat it does
init(options)yesyesStarts the SDK. Once.
identify(who)yesyesSays who the person is, and their account.
reportError(error)yesyesReports an error your code caught.
track(name, props)yesnoSends a custom event.
flush()yesyesSends what is waiting.
getSessionId()yesnoThe current session’s id.
optOut(), optIn()yesnoStops and resumes everything for one browser.
span(name, fn)noyesRecords a step of your own inside a request.
setSpanAttributes(values), activeSpan()noyesSets attributes on the span the current code runs in, such as sypnia.case.
shutdown()noyesSends what is waiting and stops.
wrapFetchHandler(handler)noyesTraces a function from a Request to a Response.
injectTraceContext(payload), sqsTraceAttributes(attributes)noyesSends the current trace with work handed to a Lambda function or an SQS queue. See Queues and functions.
wrapSqsHandler(handle), wrapLambdaHandler(handler), traceSqsRecord(message, fn)noyesContinues that trace in the function that does the work, one span per message or invocation.
continueTrace(carrier, name, fn)noyesThe same for a worker that is not a Lambda function.
notifyNavigation(url, kind)yesnoFor framework integrations: announces a navigation before the address changes. Apps do not call it.
traceRequest(request, handle, options)noyesFor framework integrations: one traced request on a host with no Node server. Apps do not call it.

@sypnia/telemetry/next gives you the browser functions from @sypnia/telemetry/next/client, the server functions from @sypnia/telemetry/next/server, withSypnia for next.config.ts, and traceOpenNext from @sypnia/telemetry/next/opennext for Next.js on AWS Lambda.

Every SDK is one npm package, @sypnia/telemetry (version 0.4.0), with a subpath per runtime: install it once and import @sypnia/telemetry/browser, /node or /next. It replaced @sypnia/browser, @sypnia/node and @sypnia/next on 2026-11-17; those stay on npm but are not released again. What changes between versions is in the changelog.

Pages in this section

The exact shape of everything the SDKs send is the event schema for the browser and the semantic conventions for the server.

  1. Which one you need
  2. Own SDKs, a standard wire
  3. The whole public API
  4. Pages in this section

    Search pages, sections and terms