Skip to content
snagr

Any appSnagr SDK

A start event. A finish event. Snagr handles the gap.

Install Snagr's browser script to identify customers, send events and display nudges. Use a secret key on your server to confirm completed actions through /api/v1/batch. A flow follows up when its start event arrives and its finish event does not. No payment-provider migration is needed.

First recovered payment free · no card · then $29/month · 0% of what we recover

JavaScriptcheckout.js
import { createClient } from "@snagr/sdk"; const snagr = createClient({ key: "snagr_pk_…" }); // When someone startssnagr.identify({ email: user.email, emailHash });snagr.track("checkout_started", { plan: "pro", revenue: 49 }); // In your payment webhook (server, secret key)await new Snagr({ secretKey }).track({  email, event: "purchase_completed",  properties: { revenue: 49 }, messageId: order.id,});

$2,705

recovered for Snagr customers

181

payments won back

0%

of it kept by Snagr

Counted only when a customer pays after a Snagr follow-up. All accounts, June 22 – October 7, 2026.

Step 1

Get your keys and add the browser script

Create a free account and choose SDK setup. The Developers page provides a publishable key for the browser and lets you create a secret key for your server. Replace YOUR_PUBLISHABLE_KEY below; keep the queue stub before any event calls.

    HTML
    <!-- Put this before your app's event handlers --><script>  window.snagr = window.snagr || { _q: [] };  ["track", "identify", "reset", "onState"].forEach(function (method) {    window.snagr[method] = function () {      window.snagr._q.push([method, arguments]);    };  });</script><script src="https://www.snagr.sh/sdk.js"  data-key="YOUR_PUBLISHABLE_KEY" defer></script>

    Step 2

    Identify the person and send the start event

    On your server, sign the authenticated user's normalized email with your secret key. Pass only the resulting emailHash to your browser session. Then identify the person and track the action that should start a flow. Never expose the secret key in browser code.

      JavaScript
      // On your server, after authenticating the user:import { createHmac } from "node:crypto";const emailHash = createHmac("sha256", process.env.SNAGR_SECRET_KEY)  .update(user.email.trim().toLowerCase()).digest("hex"); // Pass emailHash to your authenticated browser session:window.snagr.identify({ email: user.email, userId: user.id, emailHash });window.snagr.track("checkout_started", { url: resumeUrl });

      Step 3

      Send the finish event from your server

      Send purchase_completed after a verified payment, or onboarding_completed after setup finishes. Revenue is in major currency units, so convert cents before sending it. Use a stable messageId for retry safety. Keep currency consistent with your recovery reporting.

        JavaScript
        // In your server, after verifying the payment webhook:const response = await fetch("https://www.snagr.sh/api/v1/batch", {  method: "POST",  headers: {    Authorization: "Bearer " + process.env.SNAGR_SECRET_KEY,    "Content-Type": "application/json",  },  body: JSON.stringify({ batch: [{    type: "track", email: customer.email,    event: "purchase_completed", messageId: order.id,    properties: { revenue: order.amount / 100, currency: "USD" },  }] }),});const result = await response.json();if (!response.ok || !result.results?.every((item) => item.ok)) {  throw new Error("Snagr event delivery failed");}

        Step 4

        Review a flow and verify the install

        In Sequences, choose the checkout, signup or trial recipe. Confirm the start and stop event names, edit the copy, and check the return URL. Send a test to an address you own and check the events in Activity. Activate the flow only after reviewing it.

          Live

          3 recovered · 5 recent

          As events come in

          The latest opens, clicks and recoveries.

          • Recovered $83.00 from maya@finchworks.io

            just now

          • kai@orbitly.app clicked “Your checkout is saved”

            3 minutes ago

          • Recovered $49.00 from sofia@lumen.dev

            11 minutes ago

          • j.tan@quillpad.io opened “Forget something?”

            24 minutes ago

          • Recovered $149.00 from ari@nimbusmail.com

            41 minutes ago

          Pricing

          Free until it pays for itself

          Start free with every feature. Pay only once Snagr has recovered a payment, and keep 100% of what comes back.

          Free

          $0

          until your first recovered payment

          Start free
          • Every feature until your first recovered payment
          • Polar or Stripe connect, and the SDK
          • Recovery emails and on-site nudges
          • Revenue analytics, free forever

          Pro

          Most popular

          $29

          per month

          Start recovering free
          • Unlimited recovery, after your first win
          • AI-personalized emails and nudges
          • Flags, webhooks and custom flows
          • Your own sending domain
          • Agent setup over MCP

          No card to start · 0% of what we recover · cancel anytime · compare plans

          Questions

          Something else? Ask us.

          Yes. Use the server API with a secret key and the person's email. Browser installation is needed for on-site nudges and flags; server events can run email recovery by themselves.

          A publishable key is visible to visitors. By default, browser events cannot make Snagr send to an arbitrary email. Your server verifies the address through a signed emailHash or a secret-key event. Leave unverified email sending disabled.

          The batch endpoint accepts identify or track messages. A track message names the event and identifies the person by anonymousId, userId or a server-supplied email. Include messageId for idempotency and a usable url in start-event properties for the follow-up link.

          Yes. Follow the agent install guide and connect Snagr's MCP server with a secret key. The agent can inspect events and create inactive flows for your review.