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.

Step 1: Configure Checkpoints in Flock Dashboard

  1. Log in to your Flock account at app.withflock.com
  2. Navigate to the campaign where you want to configure checkpoints
  3. In the campaign settings, select the checkpoint that should trigger rewards

Step 2: Trigger Checkpoints via API

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:
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'
});