Skip to main content
This page covers the browser SDK, @miradorlabs/web-sdk.
Server-side? Use the standard OpenTelemetry SDK for your language — Python, Go, Java, .NET, Rust, Ruby, PHP, and more all export to Mirador over OTLP with no Mirador package. The Node.js SDK is deprecated.

Install

Initialize the client

Use a web key (mir_web_*) in the browser. Web keys are validated against the key’s allowed origins, so they are safe to ship in client bundles. Server keys (mir_srv_*) must never appear in browser code.

Configuration

Custom gateway URL

If you’re using a self-hosted gateway or a different environment:

Custom keep-alive interval

Debug mode and plugins

See Client Options for the full list of configuration options.

Module formats

ESM import

CDN / browser global

Load the SDK directly from a CDN — no bundler required:
Then use the MiradorWeb global:
Pin to a specific version (e.g. @2.0.0) in production to avoid unexpected breaking changes.

Browser requirements

The SDK requires modern browser features:
  • ES2020+ - Modern JavaScript syntax
  • Fetch API - For network requests
  • Promises - For async operations

Supported browsers

Polyfills

For older browsers, you may need to include polyfills:

Verifying installation

The trace appears in the Mirador dashboard within a few seconds.

Next steps

Web SDK overview

Features, when to use it, and how it relates to OpenTelemetry

Core concepts

Traces, spans, events, and attributes