Overview
Instead of hardcoding access rules in HTML, you can:- Define content items in your dashboard
- Set access rules (plans, custom conditions)
- Reference content by ID in your code
- SDK automatically enforces access
Creating Member Content
Via Dashboard
- Go to Gated Content in your dashboard
- Click Create Content
- Configure:
- Name (e.g., “Premium Course”)
- URL pattern (e.g.,
/courses/*) - Required plan(s)
- Redirect URL for unauthorized users
- Save
Via API
Checking Access
SDK Method
Response
URL Pattern Matching
Define URL patterns to automatically protect pages:Auto Protection
Enable automatic protection based on URL patterns:- SDK checks URL against member content patterns
- If match found, access is verified
- Unauthorized users are redirected
React Integration
Plan-Based Access
Single Plan
Multiple Plans (OR)
Plan Hierarchy
Configure plan hierarchy in settings:Custom Access Rules
For advanced scenarios, use custom rules:Handling Denied Access
Redirect
Show Upgrade Prompt
Webhooks
Track content access attempts:Best Practices
Use Descriptive Names
Use Descriptive Names
Name content clearly (e.g., “Premium Video Course” not “Content 1”).
Provide Clear Upgrade Paths
Provide Clear Upgrade Paths
Always show users how to get access to protected content.
Cache Access Checks
Cache Access Checks
The SDK caches access checks to minimize API calls.