This guide explains how to trigger rewards programmatically by ingesting a checkpoint to Flock’s API.
For security reasons, rewards can only be triggered via the server-side API, not directly from client-side SDKs. All checkpoint events must be sent through your backend using the /checkpoints/ingest endpoint.
Checkpoints provide a way to track key milestones in your user journey. When a checkpoint is triggered, the Flock backend can determine if a reward should be issued based on your campaign configuration.
To trigger a checkpoint, you need to either call use our server-side SDK or make a POST request to the /checkpoints/ingest endpoint with the following data:
Copy
import { FlockSDK } from '@wflock/node-flock';const sdk = new FlockSDK({ accessKey: 'your-service-access-key',});await sdk.checkpoints.ingest('purchase_completed', { externalUserId: 'user_123', // This is the user ID in your system environment: 'production', // or 'test'});