Types of Notifications π¬
1. π± Direct Text Notifications
Direct text notifications allow you to send immediate messages to specific OMI users. This is useful for alerts, updates, or responses to user actions.Example Use Cases
- Send task reminders and event notifications
- Notify users about service updates or changes
- Deliver real-time alerts and warnings
- Respond to user queries or actions
- Announce new features or important changes
2. π― Proactive Notifications
Proactive notifications are context-aware, AI-generated messages that leverage user data to send personalized, intelligent notifications during real-time conversations. Unlike direct notifications where you send the exact message text, proactive notifications let you provide a prompt template and Omi generates the final message based on user context.Example Use Cases
- Provide real-time mentoring advice during meetings
- Suggest relevant information based on conversation topics
- Offer context-aware reminders
- Send personalized insights based on userβs goals and history
- Trigger intelligent responses to specific conversation patterns
Implementing Notifications π οΈ
Step 1: Set Up Authentication π
Before sending notifications, youβll need:- Your OMI App ID (
app_id) - Your OMI App Secret (API Key)
Step 2: Configure Your Endpoint π
Base URL and Endpoint
Required Headers
Query Parameters
Step 3: Implement the Code π»
Hereβs a complete Node.js implementation:Step 4: Test Your Implementation π§ͺ
-
Set up your environment variables:
-
Test with a sample notification:
- Verify the notification appears in the userβs OMI app
Best Practices π―
-
Rate Limiting
- Implement reasonable delays between notifications
- Avoid sending duplicate notifications
- Group related notifications when possible
-
Content Guidelines
- Keep messages concise and clear
- Include relevant context
- Use appropriate urgency levels
-
Error Handling
- Implement retry logic for failed attempts
- Log errors for debugging
- Monitor notification delivery status
-
Security
- Store API credentials securely
- Validate user IDs before sending
- Implement request timeouts
Troubleshooting π
Common Issues
-
Authentication Errors
- Verify your API credentials
- Check the Bearer token format
- Ensure environment variables are set
-
Delivery Issues
- Validate the user ID exists
- Check message encoding
- Verify network connectivity
-
Rate Limiting
- Monitor API response headers
- Implement exponential backoff
- Track notification frequency
Error Response Codes
| Status Code | Meaning | Action |
|---|---|---|
| 401 | Unauthorized | Check API credentials |
| 404 | User not found | Verify user ID |
| 429 | Too many requests | Implement rate limiting |
| 500 | Server error | Retry with backoff |
Example Implementations π‘
1. Task Reminder
2. Service Update
Implementing Proactive Notifications π
Proactive notifications require creating an OMI app with specific capabilities. Unlike direct notifications, these leverage the app system to access user context and generate intelligent, personalized messages.Step 1: Create Your OMI App π
First, create an app in the OMI App Store with the following configuration: Required Capabilities:external_integration- Enables real-time transcript webhooksproactive_notification- Allows sending AI-generated contextual notifications
| Scope | Template Variable | Description |
|---|---|---|
user_name | {{user_name}} | Userβs name |
user_facts | {{user_facts}} | Userβs known facts |
user_context | {{user_context}} | Relevant conversation context |
user_chat | {{user_chat}} | Recent chat history with app |
Step 2: Set Up Your Webhook Server π
Your appβs webhook endpoint receives real-time transcripts during conversations. When you want to send a notification, return a notification prompt in your webhook response. Webhook receives:session_id: Unique conversation identifiersegments: Array of transcript segments with speaker info- User context (based on requested scopes)
Step 3: Deploy and Publish Your App π»
- Deploy your webhook server to a public HTTPS endpoint
- Test your app in Developer Mode
- Submit for review in the OMI App Store
- Users install your app and grant permissions
Step 4: Test Your Implementation π§ͺ
- Enable Developer Mode in OMI app (Settings β Developer Mode)
- Install your app in Developer Mode
- Set webhook URL in Developer Settings
- Grant requested scopes to your app
- Start a conversation with trigger phrases
- Verify notification appears
- App configuration has both required capabilities
- Webhook endpoint is publicly accessible via HTTPS
- User has installed the app
- User has granted the requested scopes
- Webhook returns proper notification format
- Notification appears within 30 seconds
Best Practices π―
For Direct Notifications:- Implement rate limiting
- Keep messages concise
- Validate user IDs
- Handle errors gracefully
- Only trigger on relevant conversation moments
- Use session state to avoid duplicate notifications
- Keep prompts under 128,000 characters
- Test with different user contexts
Troubleshooting π
Common Issues
Direct Notifications:- Authentication Errors - Verify API credentials and Bearer token format
- Delivery Issues - Validate user ID exists
- Rate Limiting - Implement exponential backoff
- Not Appearing - Check
proactive_notificationcapability is enabled - Messages Too Short - Add specific instructions to prompt (min 5 characters)
- Not Contextual - Request additional scopes in app configuration
Error Response Codes
| Status Code | Meaning | Action |
|---|---|---|
| 401 | Unauthorized | Check API credentials |
| 404 | User not found | Verify user ID |
| 429 | Too many requests | Implement rate limiting |
| 500 | Server error | Retry with backoff |
Example Implementations π‘
1. Real-Time Mentor
2. Meeting Insight Generator
Need Help? π€
- Check our API Reference
- Join our Discord community
- Contact support