Last updated Nov 8, 2025

JavaScript SDK

Instrument web and server runtimes with the official Fumi JavaScript SDK.

Installation

Install directly from the monorepo so you can pin a tag or commit for reproducible builds.

# npm
npm install git+https://github.com/fumi-ops/fumi.git#packages/sdk-js

# or Bun
bun add github:fumi-ops/fumi#packages/sdk-js

The package ships as modern ESM and runs on Bun, Cloudflare Workers, Node.js 18+, and other fetch-compatible runtimes.

Basic usage

import { Fumi } from "@fumi/sdk-js";

const client = new Fumi(
  process.env.FUMI_API_KEY!,
  "https://your-worker.workers.dev"
);

await client.track({
  name: "user.signup",
  severity: "info",
  payload: { userId: "123" },
});

Advanced options

  • Contexts: Supply contextId to group events by environment or workflow.
  • Retries: Wrap calls in your job runner to retry on transient network errors.
  • Browser support: Use dynamic imports and only expose public events to avoid leaking secrets.
  • Pin versions: Reference a Git tag or commit SHA in the install URL to lock deployments.

Next steps

  • Explore the quickstart for end-to-end validation.
  • Review the Python or Go SDK guides for polyglot environments.