Skip to content

OctaP SDK

Add loyalty points and vouchers to your store. Your server issues points and sells vouchers with the Node SDK. Your website signs customers in with the Browser SDK, and customers approve their own spending on their device.

Your website

@octap/browser-sdk

  • Google sign-in
  • Customer session
  • Signs spending on the device

Holds no merchant credential

Your server

@octap/sdk

  • Earn, balance and history
  • Vouchers and redemption
  • Webhooks, customer verification

Holds your API key

Run by OctaP

Core API and Sui

  • Records every command
  • Sui holds confirmed points
  • Sends signed webhooks

Your data stays in your organization

Issue points when a customer pays, in a few lines.

Backend quickstart →

Add Google sign-in the way you would add Firebase Auth.

Frontend quickstart →

server.ts
import { createOctaPointClient } from '@octap/sdk';
const client = createOctaPointClient({
baseUrl: process.env.OCTAP_API_URL,
credentials: { apiKey: process.env.OCTAP_API_KEY },
});
const earn = await client.earnPoints({
organizationEndUserId: memberId,
purchaseAmount: 100000,
idempotencyKey: 'order-42',
});
// earn.status === 'PENDING', earn.estimatedPoints === 1000 at a 1% earn rate
  1. Keep your API key on your server. The Browser SDK never needs it.
  2. Pending is not final. Points are spendable, and a paid voucher is owned, only after the chain confirms. See Points lifecycle.
  3. Retry with the same key. After a failure you can’t explain, read the current state, then repeat the request with the same idempotency key. See Idempotency and recovery.