API & SDK

Connect your product to Claimr

Connect accounts, product activity and campaign progress to the experience you already have. Use the API on your server, the SDK in your frontend and webhooks between systems.

Your product + Claimr
Your backendPrivate API tokenREST APIAccounts and activity
Your frontendUser-specific tokenWidget SDKDisplay and controls
Claimr eventsCampaign activityYour serverWebhook receiver

Your organization API token stays on your server

Integration examples

Start with one connection

Link an account, open a quest, or register a webhook. Each example identifies where the code runs and links to the full reference.

REST API - server-side

Link your signed-in account

Request a user token from your backend for an authenticated account. Pass that user's token to the Widget, never the organization API token.

Server-side pattern with placeholder account values. Authorize the signed-in user before choosing the account identifier. Treat the response token as sensitive.

User-token guide
JavaScript example
// Run on your server, not in the browser
const apiToken = process.env.CLAIMR_API_TOKEN;
if (!apiToken) throw new Error("Missing API token");

const url = new URL("https://prod.claimr.io/api/v1/token");
url.searchParams.set("account", "YOUR_ACCOUNT_ID");
url.searchParams.set("platform", "YOUR_PLATFORM");

const response = await fetch(url, {
  headers: { Authorization: `Bearer ${apiToken}` },
  cache: "no-store",
});
if (!response.ok) throw new Error(`Claimr: ${response.status}`);
const result = await response.json();
// Handle the documented response on your backend

Example only - this page does not execute the code

What you can connect

Your data, events, and interface

Use REST API calls for backend operations and the Widget SDK for supported browser interactions. Webhooks bring campaign events back to your server.

API

Accounts & progress

Link identities and retrieve activity, points and campaign progress.

API

Product events

Send custom activity and task values that your campaign is configured to recognize.

API

Referrals & rewards

Work with referral relationships, invite codes and XP operations.

SDK

Widget interactions

Open quests, manage supported sign-in flows and respond to Widget callbacks.

Browse API methods

User identity

Two tokens with different jobs

Your backend authenticates the account. It keeps the organization credential private and passes only the intended user's token to their Widget.

On your server

Organization API token

Authorizes private API requests. Keep it in your backend environment and out of browser code, examples, and logs.

For one user

Account-linked user token

Connects the signed-in account to Claimr. Return it only to the user your backend has authenticated.

Before launch, test account switching, repeated events, and webhook verification. Frontend completion is only for tasks configured to accept it.

Customer story · Testnet to builders

Connect custom chain activity to campaign progress

For one EVM testnet, Claimr’s custom task integration recorded faucet activity and weekly streaks alongside developer quests and submitted work. Completion methods stayed specific to each task.

Read the case study

Anonymous EVM testnet · 2024 program · Full exported cohort

Faucet task completions
~756,000

Repeat-inclusive completion events from the custom on-chain faucet check, across about 47,000 accounts.

How it’s measured for faucet task completions
Qualified for the weekly faucet streak
~17,600

Accounts completing the weekly streak task, configured to require seven consecutive daily claims.

How it’s measured for qualified for the weekly faucet streak

Questions

Before you connect

Security & data handling
Do I need the SDK if I only use the REST API?

No. Use the REST API for backend operations without adding the Widget SDK. Add the SDK when the frontend needs supported Widget methods or callbacks.

Can I use the API and Widget together?

Yes. You can use the Widget for the customer-facing experience and server-side API calls for connected data and operations. Plan account linking so both refer to the same user.

What is the difference between an API token and a user token?

The organization API token authorizes backend requests and must remain private. A user token links a particular account to Claimr and is passed to that user's Widget. Your backend should authenticate the user before requesting or returning their token.

Can I complete any task from the frontend?

No. The SDK's complete_task method is documented for tasks configured as Front End type. Do not use a browser-only signal as proof of a backend action that needs independent verification.

Where are the exact request and response schemas?

Follow the linked API reference for endpoint requirements, parameters and responses, and the SDK guide for client methods. The examples here are starting patterns with placeholder identifiers.

How do webhooks connect to my application?

Configure a receiving server endpoint and register the event scopes you need. Review campaign scope, signature verification and duplicate handling before connecting production workflows.

Build your first integration

Start with account linking and one product event. Use the documentation for exact requests, responses, and SDK methods.