Overview
The Trending Society API supports two authentication methods:- JWT Bearer Token - For user-authenticated requests
- API Key - For server-to-server and agent requests
Bearer Token (JWT)
For user-facing applications, use Supabase Auth JWTs:Obtaining a Token
- Email/Password
- OAuth
- Magic Link
Token Contents
JWTs contain:API Key
For server-to-server communication and AI agents:Key Types
| Type | Prefix | Use Case |
|---|---|---|
| Development | mcp_dev_ | Local testing |
| Production | mcp_live_ | Production agents |
| Service | srv_ | Internal services |
Creating API Keys
1
Navigate to Dashboard
Go to Settings > API Keys in the dashboard
2
Create New Key
Click “Create API Key” and select the scope
3
Copy Key
Copy the key immediately - it won’t be shown again
4
Store Securely
Add to environment variables or secrets manager
MCP Server Authentication
The MCP server atmcp.trendingsociety.com uses API key authentication:
Claude Desktop
Cursor
Direct HTTP
Rate Limiting
| Endpoint | Limit | Window |
|---|---|---|
| API (authenticated) | 1000 req | per minute |
| API (unauthenticated) | 60 req | per minute |
| MCP tools | 100 req | per minute |
Error Responses
401 Unauthorized
403 Forbidden
429 Rate Limited
Security Best Practices
Never expose keys in client code
Never expose keys in client code
API keys should only be used server-side. For client apps, use JWT tokens from user authentication.
Rotate keys regularly
Rotate keys regularly
Create new keys periodically and deprecate old ones. The dashboard shows last usage time to identify unused keys.
Use environment variables
Use environment variables
Never commit keys to version control. Use environment variables or a secrets manager.
Scope keys appropriately
Scope keys appropriately
Create separate keys for different environments and use cases. Production keys should have minimal required permissions.