Each provider is enabled by its own env vars. The environment variables reference lists the exact names.
- An OpenAI key for embeddings, which power retrieval over large knowledge bases
- A Black Forest Labs key for FLUX images and video, or Google Vertex for Imagen and Veo
- A SerpAPI key for web search
- Google or Microsoft OAuth for the email client
- A LinkedIn app for publishing drafts
- SMTP (
SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASSWORD,MAIL_FROM). The verify, welcome and invitation emails need it. Without SMTP, invitations still work: the invite link shown in the org settings can be shared by hand. - An email allowlist (
ALLOWED_LOGIN_EMAILS), see Restricting sign-up
Connections
Mail and LinkedIn posting use connections, which reuse the Google and Microsoft OAuth apps used for sign-in (GOOGLE_CLIENT_ID, MICROSOFT_CLIENT_ID). LinkedIn uses its own app (LINKEDIN_CLIENT_ID). Two more steps are needed:
-
Set
APP_KEY, the key that encrypts stored connection tokens. See Setting APP_KEY. Without it, connecting fails with “APP_KEY is not set”. -
Add this redirect URI to each provider app, with
API_BASE_URLas the host:https://api.example.com/integration/oauth/callbackThe API logs the exact URI at startup.
Setting APP_KEY
APP_KEY is generated once and then kept like a database password. Every API and worker process needs the same value. A new key makes every stored connection unreadable, so users have to connect again.
| Setup | How to set it |
|---|---|
| Quickstart installer | The installer writes it to .env. Nothing else to do. |
| Local development | Run pnpm key:generate. It writes the key to .env and keeps an existing key unless --force is passed. A new .env is readable only by its owner. |
| Kubernetes, other runtimes | Create the key once and store it in the secret store, then expose it to the API and the worker as APP_KEY. |
For Kubernetes, for example:
APP_KEY="base64:$(openssl rand -base64 32)"
kubectl create secret generic ragna-app-key --from-literal=APP_KEY="$APP_KEY"pnpm key:generate --show prints a new key without writing it. Never generate the key at container start: each restart or replica would get a different one.
To rotate the key, set the new value as APP_KEY and move the old one to APP_PREVIOUS_KEYS. Existing connections keep working.
The API and the worker check both variables when they start:
APP_KEYnot set: they start and log a warning. Connecting integrations is disabled.APP_KEYmalformed: they refuse to start and log an error. A valid key isbase64:followed by 32 random bytes.- An entry in
APP_PREVIOUS_KEYSmalformed: they start, log its position and ignore it. Connections stored with the current key keep working.
Add the mail scopes (gmail.modify for Google, Mail.ReadWrite and Mail.Send for Microsoft) and for LinkedIn the Share on LinkedIn product (w_member_social).
Google Drive
The cloud drive integration needs two more steps in the Google Cloud project:
-
Enable the Google Drive API.
-
Add these scopes to the OAuth consent screen:
https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.file
Google classes both as restricted scopes. A public app needs Google’s app verification for them. An internal Workspace app or an app with a small list of test users does not.