How Do I Add Notifications to My App?
You built an app with Claude, ChatGPT, Bolt, or Lovable and users need to be notified when things happen. A new message arrives. An order ships. Something…
You built an app with Claude, ChatGPT, Bolt, or Lovable and users need to be notified when things happen. A new message arrives. An order ships. Something needs their attention. Right now the only way they find out is by logging in and looking. You want notifications, but the word covers several completely different things. Here is what the options are, which one is right for your situation, and how to implement each one.
The Three Types of Notifications
These are fundamentally different technologies with different use cases. Knowing which one you need saves significant time.
In-app notifications: a notification bell icon in your app that shows a count of unread items. When clicked, it shows a list of recent notifications. The user only sees these when they are actively using your app.
Email notifications: you send an email when something important happens. The user sees it in their inbox whenever they check email. We covered how to send emails from your app in an earlier post.
Push notifications: a notification that appears on the user’s phone or browser even when they are not in your app. The most powerful but also the most complex to implement.
In-App Notifications: The Simplest Starting Point
In-app notifications are stored in your database and shown in your app’s UI. When something happens, you create a notification record. Your app fetches unread notifications and shows the count.
Ask your AI: “Can you add in-app notifications to my app? When [describe the triggering event, e.g. a new message is received, an order status changes], create a notification record in the database for the relevant user. Add a notification bell to the app header that shows the count of unread notifications and a dropdown list when clicked. Mark notifications as read when viewed.”
Your AI will create a notifications table in your database, add the logic to create notifications when events happen, and build the frontend bell and dropdown.
Email Notifications: The Highest Reach
Email reaches users wherever they are and requires no additional app implementation beyond what we covered in the email sending post. The key is sending emails at the right moment without overwhelming people.
Best practices for notification emails:
- Only send for genuinely important events, not every minor action
- Let users control which notifications they receive via email preferences
- Include a one-click unsubscribe link in every notification email
- Make the subject line specific enough that the user knows what happened
Ask your AI: “When [describe the event] happens in my app, can you trigger an email to the relevant user notifying them? Use [your email service]. The email should include [describe what information to include].”
Push Notifications: For Mobile and Real-Time Urgency
Push notifications appear on a user’s device even when they are not using your app. They are powerful for time-sensitive notifications but require explicit permission from users.
For web push notifications: the Web Push API lets browsers receive notifications. This works on desktop and Android. iOS Safari added support in 2023. The implementation involves service workers and a push notification service.
The simplest service for web push is OneSignal, which has a free tier and a straightforward integration. Ask your AI: “Can you add web push notifications to my app using OneSignal? Trigger a push notification when [describe the event].”
For mobile apps: if you built a mobile app, Firebase Cloud Messaging (FCM) is the standard for both iOS and Android push notifications. Ask your AI about this if you have a mobile app.
Let Users Control Their Notifications
Whatever type of notifications you add, give users the ability to choose which ones they receive. Notification fatigue is real and sending too many causes users to disable all notifications or leave entirely.
A simple preferences page with toggles for different notification types goes a long way toward keeping users engaged rather than annoyed.
Ask your AI: “Can you add a notification preferences page to my app where users can choose which types of notifications they receive via [email / in-app / push]?”
The One Thing to Remember
Notifications come in three types: in-app (shown inside your app), email (sent to their inbox), and push (appears on their device). In-app is the simplest to implement. Email has the highest reach. Push is most powerful for time-sensitive alerts but requires user permission. Start with in-app notifications and email for important events. Add push notifications when your app genuinely needs real-time urgency.
Want your notification-powered app running reliably in production? → Snapdock
New here? These might help: How do I send emails from my app? → What is a WebSocket? And when does my app actually need one? →