Authentication
How to secure your API calls
What’s This About?
When your AI needs to access secure parts of your system (like user data or private APIs), it needs the right permissions. This guide shows you how to set that up.
Two Ways to Add Authentication
1. From Your App (Dynamic Auth)
If you’re using our widget in your app, you can pass authentication tokens directly:
This is great when:
- Your users need to be logged in
- Each user has their own permissions
- You’re using JWT tokens or API keys
2. From Our Dashboard (Static Auth)
If you need to set up authentication that’s the same for everyone:
Go to Settings
Open your copilot dashboard and find “Copilot Settings”
Find Headers Section
Scroll down to “Global variables/headers”
Add Your Headers
Add any authentication headers you need:
- API keys
- Access tokens
- Custom headers
This is perfect when:
- You’re using the AI on a public website
- You don’t want to expose tokens in your frontend code
- You need the same authentication for all users
- You’re testing things out
Security & Storage
Important Security Information:
- Headers passed through the widget (
initAiCoPilot
) are never stored in our system - Only headers configured in the dashboard are stored, and these are encrypted in our database
- We follow industry-standard encryption practices to protect your sensitive data
Widget Headers
- Not stored anywhere
- Used only during runtime
- Perfect for user-specific tokens
Dashboard Headers
- Encrypted in our database
- Safely stored and managed
- Ideal for system-wide tokens
Quick Tips
Security First
Never put sensitive tokens in your frontend code if you can avoid it
Test It Out
Always test your authentication with a few API calls before going live
Need help? Join our Slack community for support!
Was this page helpful?