Overview
After a user claims an offer, Encore grants them an entitlement (free trial, discount, or credit). For security reasons, entitlement validation must be performed on your backend using server-to-server authentication with HMAC signatures.Entitlement Types
Encore supports three types of entitlements:Server-Side Validation
Backend Setup
Set up a secure endpoint on your server to validate entitlements with Encore’s API.1
Store API Credentials
Store your Encore API keys securely as environment variables.
2
Implement HMAC Signature
Create a function to generate HMAC signatures for request authentication.
3
Create Validation Endpoint
Create an endpoint on your backend to validate entitlements.
Entitlement Response Format
The Encore API returns entitlements organized by scope:all- Both provisional and verified entitlementsverified- Only verified entitlements (confirmed by advertiser)provisional- Only provisional entitlements (not yet verified)
Checking Entitlements
Frontend to Backend Flow
Your frontend should request entitlement validation from your backend:When to Use Each Scope
Use ‘all’ for Immediate UX
For the best user experience, grant access immediately when a user claims an offer:Use ‘verified’ for Revenue-Critical Decisions
For billing changes or subscription modifications, only use verified entitlements:Use ‘provisional’ for Analytics
Track provisional grants separately:Complete Backend Example
Here’s a complete example with multiple helper functions:Common Use Cases
Dynamic Feature Access
Gate features based on server-validated entitlements:Checkout Discounts
Apply verified discounts at checkout:Navigation Guards
Protect premium routes with server validation:Best Practices
1. Always Validate Server-Side
Never trust client-side validation for access control:2. Cache Validation Results
Cache entitlement validation results to reduce API calls:3. Use Appropriate Scope
Choose the right scope for your use case:4. Handle Validation Errors
Gracefully handle API failures:Security Considerations
Next Steps
You’ve learned how to validate entitlements securely on your server. Continue with:- Framework Integration Guide - Deep dive into React, Vue, Angular patterns
- SDK Reference - Complete API documentation
- Getting Started - Return to the main guide