Skip to content

Quickstart

Get from zero to your first event in the dashboard in about five minutes.

  1. Get your write key.

    In the Origamy dashboard, create a JavaScript source (or open an existing one) and copy its write key. The write key identifies your source and authorizes the SDK to send events — it is safe to expose in the browser.

  2. Paste the snippet.

    Add this to your site’s <head>, before any code that calls origamy.*. It stubs the API, queues calls, and loads the full engine asynchronously — nothing blocks your page render.

    <script>
    (function() {
    window.origamy = window.origamy || [];
    var methods = ["load", "track", "page", "identify", "alias", "group"];
    for (var i = 0; i < methods.length; i++) {
    (function(method) {
    window.origamy[method] = function() {
    window.origamy.push([method].concat(Array.prototype.slice.call(arguments)));
    };
    })(methods[i]);
    }
    var cdnHost = window.__origamyCdnHost || "https://cdn.origamy.io";
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.async = true;
    script.src = cdnHost.replace(/\/$/, "") + "/v1/analytics.min.js";
    var firstScript = document.getElementsByTagName("script")[0];
    firstScript.parentNode.insertBefore(script, firstScript);
    })();
    origamy.load("YOUR_WRITE_KEY");
    origamy.page();
    </script>
  3. Track something.

    Identify the user when you know who they are, and track the actions you care about:

    origamy.identify("user_123", {
    plan: "pro",
    });
    origamy.track("Signed Up", {
    plan: "pro",
    referrer: "producthunt",
    });
  4. Verify it arrived.

    Open Live Events in the Origamy dashboard. Your page, identify, and track calls should appear within a few seconds. If nothing shows up, check the browser console — the SDK logs delivery errors, and origamy.load("KEY", { debug: true }) makes it verbose.

Track from your backend with the Node.js, Go, or PHP SDK:

import { New, Track } from "@origamy/node-sdk";
const client = New(process.env.ORIGAMY_WRITE_KEY);
client.enqueue(new Track({ userId: "user-123", event: "Signed Up" }));
await client.close();

If your workspace runs a self-hosted (BYOD) data plane, events go to your gateway instead of Origamy Cloud. Point the SDK at it when you load:

origamy.load("YOUR_WRITE_KEY", {
apiHost: "https://events.your-domain.com",
});

Everything else — the API, the event spec, the dashboard — works the same.