Skip to main content
The Mirador SDKs let you create and manage distributed traces across your applications. Use the core SDK for tracing, events, and attributes, then add integration plugins to correlate traces with domain-specific activity — starting with Web3 and blockchain transactions. Two SDKs are available today:
  • Web SDK (@miradorlabs/web-sdk) — for browser-based applications, with automatic browser metadata collection
  • Node.js SDK (@miradorlabs/nodejs-sdk) — for server-side applications
SDKs for Python, Go, Rust, and other languages are currently in development. Contact us if you’re interested in early access.

Key Features

Fluent Builder Pattern

Clean, chainable API for building traces

Plugin System

Extensible plugin architecture for domain-specific integrations — Web3, observability, and more

Browser Metadata

Automatic collection of 27+ browser environment metrics

TypeScript Support

Full type definitions included for excellent developer experience

Blockchain Integration

Follow transactions end-to-end across chains, bridges, and protocols via the Web3 plugin

EIP-1193 Provider

Drop-in provider wrapper that auto-captures all transactions with zero config

Web3 Demo App

Interactive example app covering wallet discovery, transaction sending, and full trace lifecycle

Quick Example

Track a transaction with manual hints — works with any wallet or library:
import { Client, Web3Plugin } from '@miradorlabs/web-sdk';

const client = new Client('your-api-key', { plugins: [Web3Plugin()] });

const swapTx = {
  from: '0xYourWallet',
  to: '0xUniswapRouter',
  data: '0x38ed1739...',  // swap calldata
  value: 0n,
};

const trace = client.trace({ name: 'SwapExecution' })
  .addAttribute('from', swapTx.from)
  .addAttribute('to', swapTx.to)
  .addTags(['dex', 'swap'])
  .addEvent('swap_initiated');

const tx = await wallet.sendTransaction(swapTx);

trace.web3.evm.addTxHint(tx.hash, 'ethereum', {
  input: swapTx.data,  // emits "Tx input data" event
  details: 'Swap execution'
});

await tx.wait().then(receipt => {
  trace.addEvent('swap_confirmed', { blockNumber: receipt.blockNumber });
});
Or use sendTransaction on the trace to capture tx hints and errors automatically:
const client = new Client('your-api-key', {
  plugins: [Web3Plugin({ provider: window.ethereum })]
});

const trace = client.trace({ name: 'SwapExecution' })
  .addAttribute('from', '0xabc...')
  .addTags(['dex', 'swap']);

const txHash = await trace.web3.evm.sendTransaction({
  from: '0xabc...',
  to: '0xdef...',
  data: '0xa9059cbb...',
  chainId: 1
});
Or wrap your existing provider for zero-config capture across your whole app:
import { BrowserProvider } from 'ethers';
import { Client, MiradorProvider } from '@miradorlabs/web-sdk';

const client = new Client('your-api-key');
const provider = new MiradorProvider(window.ethereum, client);

// Wrap in ethers — all transactions are automatically traced
const ethersProvider = new BrowserProvider(provider);
const signer = await ethersProvider.getSigner();

const tx = await signer.sendTransaction({
  to: '0xUniswapRouter',
  data: '0x38ed1739...',
});

Browser Compatibility

The SDK is compatible with modern browsers:
  • Chrome
  • Firefox
  • Safari
  • Edge
For older browsers, you may need polyfills for ES2020+ features, Fetch API, and Promises.

Next Steps

Quickstart

Get up and running in minutes

Core Concepts

Learn about traces, events, and attributes

Web3 Demo App

See a full working example with real wallet interactions