Authentication
Every request to URI Social is authenticated with a single API key, sent via theX-API-Keyheader. The SDK handles this for you automatically.
API Key Authentication
Getting Your API Key
Obtain your API key from the dashboard
- 1Log in to your URI Social dashboard
- 2Navigate to the API Keys page in your dashboard
- 3Click "Generate New API Key"
- 4Copy and store your API key securely
Using Your API Key
Include your API key in the Authorization header
import { URISocial } from '@urisocial/sdk';
// The SDK attaches your API key to every request automatically
const client = new URISocial({ apiKey: 'YOUR_API_KEY' });
const content = await client.content.generate({
seedContent: 'Launch our new product line',
platforms: ['instagram', 'facebook']
});Security Best Practices
- • Never commit API keys to version control
- • Use environment variables to store API keys
- • Rotate API keys regularly
- • Use different keys for development and production
Multi-Tenant Applications
End-User Isolation
If you're building a SaaS product on top of URI Social, set an end-user ID so each of your users gets an isolated brand profile — all under your single API key
const client = new URISocial({
apiKey: 'YOUR_API_KEY',
endUserId: currentUser.id // isolates brand profiles per end-user
});
// Switch end-users dynamically
client.setEndUserId('user-456');Every request is authenticated with your single API key — endUserId and workspaceId are additional context sent alongside it (as X-End-User-ID / X-Workspace-ID headers), not a separate authentication mechanism.