Configuring Notifications in the Next.js Supabase Starter Kit
Learn how to configure notifications in the Next.js Supabase Starter Kit.
Makerkit allows you to configure and send notifications using the @kit/notifications
package. The package provides a simple API to send notifications.
There are two variables that you can set in the .env
file to configure notifications:
- NEXT_PUBLIC_ENABLE_NOTIFICATIONS: Set this to
true
to enable notifications. - NEXT_PUBLIC_REALTIME_NOTIFICATIONS: Set this to
true
to enable real-time notifications.
NEXT_PUBLIC_ENABLE_NOTIFICATIONS=trueNEXT_PUBLIC_REALTIME_NOTIFICATIONS=true
- If
NEXT_PUBLIC_ENABLE_NOTIFICATIONS
is set tofalse
, the bell icon will not appear in the header. Otherwise, it will appear. - If
NEXT_PUBLIC_REALTIME_NOTIFICATIONS
is set tofalse
, the notifications will not be real-time. Otherwise, they will be real-time.
Why would you not want to enable notifications?
If you are not using notifications in your application, you can disable them to reduce the complexity of your application. This can be useful if you are building a simple application and do not need notifications.
Real-time notifications
If you want to enable real-time notifications, you need to set the NEXT_PUBLIC_REALTIME_NOTIFICATIONS
environment variable to true
. This will enable real-time notifications in your application.
This may be your preference for a more cost-effective solution, as it will reduce the number of requests to the server.