Gately provides multiple ways to protect content on your website, from simple login requirements to plan-based access control.Documentation Index
Fetch the complete documentation index at: https://usegately.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Protection Methods
Data Attributes
Simple HTML attributes for quick protection
SDK Methods
Programmatic access control
Auto Protection
Automatic protection based on URL patterns
Member Content
Database-driven content access rules
Quick Start
Using Data Attributes
The simplest way to protect content:Using SDK Methods
Protection Levels
| Level | Description | Use Case |
|---|---|---|
| Login Required | User must be authenticated | Member-only content |
| Plan Required | User must have specific plan | Premium features |
| Custom Rules | Based on user attributes | Advanced access control |
How It Works
- SDK initializes and checks authentication
- Protected elements are identified by data attributes
- Access is checked against user’s session and plan
- Content is shown/hidden based on access rules
- Unauthorized users are redirected or shown alternatives
Configuration
Initialize Protection
Protection is automatically initialized when the SDK loads. You can customize behavior:Redirect Rules
Configure redirects in your dashboard or via API:| Trigger | Redirect To |
|---|---|
| Not logged in | /login |
| No plan access | /upgrade |
| After login | /dashboard |
| After logout | / |
Best Practices
Progressive Enhancement
Progressive Enhancement
Always provide fallback content for users without JavaScript.
Loading States
Loading States
Show loading indicators while checking access to prevent content flash.
Clear Messaging
Clear Messaging
Tell users why they can’t access content and how to get access.
Server-Side Validation
Server-Side Validation
For sensitive content, always validate access on the server too.
Security Note
Next Steps
Member Content
Database-driven content protection
Auto Protect
Automatic URL-based protection