1. Setup your environment
Grab your API key from the Scrip dashboard and set it as an environment variable:2. Create your Program & Asset
A Program is your container, and an Asset is what you’re tracking (points, credits, etc.). Let’s create a Program called “Loyalty” and a “Points” asset in one go.3. Define a Rule
Rules tell Scrip when to give out points. We’ll create a rule that gives 10 points for every event where thetype is "purchase".
4. Trigger the Reward
Now for the fun part. Send an event for a user (user_123).
Note: You don’t need to create the user first—Scrip will automatically create and enroll them when the first event arrives.
5. Verify the Balance
Wait a second for the async engine to finish, then checkuser_123’s balance. First, look up the participant by external ID to get their Scrip UUID:
id from the response to fetch their balance:
Next Steps
Now that you’ve seen the core loop, dive deeper:- Writing Rules: Use CEL to build complex logic (e.g., “double points for VIPs”).
- State Management: Use counters and tags to track user progress over time.
- Redemptions: Let users spend those points on rewards.