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
Start here
Section titled “Start here”On your server
Section titled “On your server”Issue points when a customer pays, in a few lines.
On your website
Section titled “On your website”Add Google sign-in the way you would add Firebase Auth.
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 rateKnow these three rules
Section titled “Know these three rules”- Keep your API key on your server. The Browser SDK never needs it.
- Pending is not final. Points are spendable, and a paid voucher is owned, only after the chain confirms. See Points lifecycle.
- 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.

