This guide helps administrators obtain all necessary API keys and configure authentication for the EmailBridge NLP app.
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable the Gmail API:
- Go to "APIs & Services" > "Library"
- Search for "Gmail API"
- Click "Enable"
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth 2.0 Client IDs"
- Configure OAuth consent screen if prompted:
- User Type: External (for general use) or Internal (for workspace)
- Fill required fields (App name, User support email, Developer email)
- Add scopes:
https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/gmail.send
- Create OAuth 2.0 Client ID:
- Application type: Web application
- Name: "EmailBridge NLP - Gmail"
- Authorized redirect URIs:
https://your-rocketchat-server.com/api/apps/public/[app-id]/google-oauth-callback
- Copy Client ID and Client Secret
- Configure these in Rocket.Chat App Settings under "Google OAuth"
- Go to Azure Portal
- Navigate to "App registrations"
- Click "New registration"
- Configure:
- Name: "EmailBridge NLP - Outlook"
- Supported account types: "Accounts in any organizational directory and personal Microsoft accounts"
- Redirect URI: Web -
https://your-rocketchat-server.com/api/apps/public/[app-id]/outlook-oauth-callback
- Go to "API permissions" in your app registration
- Add permissions:
- Microsoft Graph > Delegated permissions:
Mail.Read- Read user mailMail.Send- Send mail as a userUser.Read- Sign in and read user profile
- Microsoft Graph > Delegated permissions:
- Click "Grant admin consent" (if you're an admin)
- Go to "Certificates & secrets"
- Click "New client secret"
- Add description and set expiration
- Copy the Value (not the Secret ID)
- Copy Application (client) ID from "Overview" page
- Copy Client Secret from previous step
- Configure these in Rocket.Chat App Settings under "Outlook OAuth"
- Go to OpenAI Platform
- Sign up or sign in to your account
- Go to API Keys page
- Click "Create new secret key"
- Give it a name (e.g., "EmailBridge NLP")
- Copy the API key (starts with
sk-) - Important: Store this key securely - you won't be able to see it again
- Go to Billing page
- Add payment method
- Set usage limits if desired
- Configure the API key in Rocket.Chat App Settings under "LLM Configuration"
- Or users can configure personal API keys via
/email llm-config
- Go to Google AI Studio
- Sign in with your Google account
- Click "Get API key"
- Create new API key or use existing project
- Copy the API key
- Configure the API key in Rocket.Chat App Settings under "LLM Configuration"
- Or users can configure personal API keys via
/email llm-config
- Go to Groq Console
- Sign up with your account
- Go to API Keys section
- Click "Create API Key"
- Give it a name
- Copy the generated key
- Store securely
- Configure the API key in Rocket.Chat App Settings under "LLM Configuration"
- Or users can configure personal API keys via
/email llm-config
The app supports OpenAI-compatible APIs, including:
- Ollama (with OpenAI compatibility layer)
- LocalAI
- OpenAI-compatible servers
- Custom LLM APIs
- Your LLM server must support OpenAI-compatible chat completions endpoint
- Endpoint format:
POST /v1/chat/completions - JSON request/response format matching OpenAI specification
- In app settings or via
/email llm-config, set:- Provider: Self-hosted
- URL: Your LLM server URL (e.g.,
http://localhost:11434for Ollama)
- The app will automatically append
/v1/chat/completionsif needed
- Ollama:
http://localhost:11434 - LocalAI:
http://localhost:8080 - Custom server:
https://your-llm-server.com:8000
- Go to Administration > Apps > EmailBridge NLP > Settings
- Configure global settings:
- Google OAuth Client ID & Secret
- Outlook OAuth Client ID & Secret
- Default LLM Provider
- Default LLM API Keys
Users can override admin settings with personal configurations:
- Use
/email configfor email provider preferences - Use
/email llm-configfor personal LLM settings
- Never commit API keys to version control
- Use environment variables or secure storage
- Rotate keys regularly
- Monitor API usage and costs
- Set usage limits where possible
- Use HTTPS for all redirect URIs
- Verify redirect URI matches exactly
- Configure appropriate scopes (minimum required)
- Review and audit OAuth permissions regularly
- Grant minimum required permissions
- Review user access regularly
- Monitor API usage logs
- Configure rate limiting if available
- Verify API key is correct and not expired
- Check if billing is configured (OpenAI)
- Ensure API key has required permissions
- Verify redirect URI matches exactly (including http/https)
- Check app ID in the callback URL
- Ensure OAuth app is approved/published
- Check API usage limits
- Upgrade plan if needed
- Implement usage monitoring
- Verify server is running and accessible
- Check URL format and endpoint availability
- Test with curl/Postman first
- Review server logs for errors
- Check Rocket.Chat app logs in Administration > View Logs
- Enable debug logging in app settings
- Review provider-specific documentation
- Open GitHub issue with detailed error information
- Google Cloud project created
- Gmail API enabled
- OAuth 2.0 credentials configured
- Redirect URI added with correct app ID
- Client ID & Secret added to app settings
- Azure app registration created
- Microsoft Graph permissions configured
- Client secret generated
- Application ID & Secret added to app settings
- LLM provider account created
- API key generated
- Billing configured (if required)
- API key added to app settings or user config
- Test query executed successfully