Workspace connections
Enable the connections now offered in the product: Google Drive, Slack, GitHub, and opt-in Gmail.
Enable secure credential storage first
Every workspace connection needs EMBEDDING_SECRETS_KEY plus its OAuth client pair. Without both, the product reports the provider as not configured. Generate the encryption key from 32 random bytes encoded as base64 and preserve it for the lifetime of stored grants.
openssl rand -base64 32Compose already forwards EMBEDDING_SECRETS_KEY. Forward the connection-specific environment variables into app and worker in your operator override as well.
Provider configuration
Register each callback on BETTER_AUTH_URL, your public product origin. Connection credentials are separate from AUTH_GOOGLE_* and AUTH_GITHUB_* social sign-in credentials.
- Google Drive
- GOOGLE_OAUTH_CLIENT_ID + GOOGLE_OAUTH_CLIENT_SECRET. Callback: /api/connectors/google/oauth/callback.
- Slack
- SLACK_CLIENT_ID + SLACK_CLIENT_SECRET. Callback: /api/connectors/slack/oauth/callback.
- GitHub
- GITHUB_OAUTH_CLIENT_ID + GITHUB_OAUTH_CLIENT_SECRET. Callback: /api/connectors/github/oauth/callback.
- Gmail · opt-in
- The Google OAuth pair plus GMAIL_CONNECTOR_ENABLED=true. Uses a separate mailbox grant and the shared Google callback; reads mail without sending or deleting it.
- Microsoft 365 (OneDrive and SharePoint)
- MICROSOFT_OAUTH_CLIENT_ID + MICROSOFT_OAUTH_CLIENT_SECRET from one Microsoft Entra app registration, separate from the AUTH_MICROSOFT_* sign-in app. Callback: /api/connectors/microsoft/oauth/callback. Delegated Microsoft Graph permissions: Files.Read.All, Sites.Read.All, offline_access, openid, email, profile. MICROSOFT_OAUTH_TENANT_ID limits connections to one organisation; it defaults to common. Reads files without changing or deleting them.
- Outlook · opt-in
- The Microsoft OAuth pair plus OUTLOOK_CONNECTOR_ENABLED=true, with the delegated Mail.Read permission added to the same app registration. Each member connects their own mailbox through the shared Microsoft callback; reads mail without sending or deleting it.
- Drive folder import · opt-in
- GOOGLE_DRIVE_FOLDER_ACCESS_ENABLED=true lets an admin add read-only Drive access after connecting (Allow folder access), so a picked or pasted folder imports with its subfolders, including folders shared with the account and shared drives. Connecting itself asks only for the files picked one by one, so it never shows Google's unverified-app warning; only allowing folder access does, until the app is verified. Without the flag, only files picked one by one can be imported. The connection belongs to the workspace, so once folder access is allowed every admin can import from the connected account's whole Drive, and the short-lived token the Google Picker receives in the browser can read all of it.
Gmail uses the restricted gmail.readonly scope, and Drive folder import the restricted drive.readonly scope. Prepare the Google consent screen and the verification or internal-app setup before enabling either for users. For Microsoft 365, Sites.Read.All needs an administrator's consent in most tenants, and tenants that restrict user consent need the same for Mail.Read: grant admin consent in your own directory, or expect each customer's administrator to approve the app the first time someone there connects.
Google Picker and linked editing
The Google file picker needs NEXT_PUBLIC_GOOGLE_API_KEY (a restricted browser API key) and NEXT_PUBLIC_GOOGLE_APP_ID (the numeric project ID) at web-app build time.
GOOGLE_DOCS_EDITING_ENABLED=true enables the separate Drive-linked editing capability. It is not required merely to configure a Drive knowledge connection.
Host-local agent sources
AGENT_KNOWLEDGE_CONNECTOR_ENABLED with AGENT_KNOWLEDGE_PROJECT_ROOTS enables access to configured project roots on the server host. AGENT_SESSIONS_CONNECTOR_ENABLED enables local agent transcript sources. These are optional personal-instance capabilities: a hosted server does not gain access to a visitor's local computer.