Skip to content
Codeskop

Quick Start for Web

Add Codeskop to any browser app and start seeing JavaScript errors and failing network calls from real users.

Be up and running in under 5 minutes

Install one package, call init once, and uncaught errors, unhandled rejections and every fetch/XHR call are captured automatically.
  1. Install the package

    Add @codeskop/tracker from npm. It has no runtime dependencies.

    Terminal
    npm install @codeskop/tracker

    Latest version: 1.3.0

    The package is free and MIT-licensed on the public npm registry, no token or .npmrc setup needed. Using React? Also see the React guide.
  2. Initialize Codeskop

    Call init as early as possible (ideally at the top of your entry file) so capture starts before your app code runs.

    main.ts
    import { init } from "@codeskop/tracker"; init({  apiKey: "cs_live_pk_YOUR_KEY",  release: "1.4.0", // optional: your app's version});

    Get your ingest key

    Create a project in the Codeskop dashboard and copy its public key. It starts with cs_live_pk_ (or cs_test_pk_ for testing). Public keys can only write events, so they're safe in browser code. Never use a secret key (cs_…_sk_); the SDK refuses it and stays off.

    That's the whole integration for error and network capture. init returns immediately and does its work in the background.

  3. Identify your users

    Optional, but recommended: see which users an issue affects.

    auth.ts
    import { identify, reset } from "@codeskop/tracker"; // After a successful login, use your own stable user id, never an emailidentify(user.id); // On logoutreset();

    Pass an ID from your own system. Until you call identify, events are tied to an anonymous ID stored in the browser.

  4. Verify installation

    Send a test event and confirm it reaches your dashboard.

    Browser console or a debug button
    import { recordException, flush } from "@codeskop/tracker"; recordException(new Error("Codeskop test event"));await flush(); // sends the queue right away instead of waiting for the next sync

    Open your project in the dashboard to see the event. Without flush(), the SDK sends events in batches: when 20 are queued, every 30 seconds, when the browser comes back online, or when the tab is hidden.

    Nothing showing up?

    Check the key is a public pk key and your plan is active, then look for the /v1/events request in your browser's Network tab. The troubleshooting guide covers every common cause.

Next steps