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.
Steps to configure notifications
Learn how to configure notifications in the Next.js Supabase Starter Kit.
There are two variables that you can set in the .env file to configure notifications:
- NEXT_PUBLIC_ENABLE_NOTIFICATIONS: Set this to
trueto enable notifications. - NEXT_PUBLIC_REALTIME_NOTIFICATIONS: Set this to
trueto enable real-time notifications.
NEXT_PUBLIC_ENABLE_NOTIFICATIONS=trueNEXT_PUBLIC_REALTIME_NOTIFICATIONS=trueEnabling notifications
If NEXT_PUBLIC_ENABLE_NOTIFICATIONS is set to false, the bell icon will not appear in the header. Otherwise, it will appear.
NEXT_PUBLIC_ENABLE_NOTIFICATIONS=false # Disable notificationsEnabling real-time notifications
If NEXT_PUBLIC_REALTIME_NOTIFICATIONS is set to false, the notifications will not be real-time. Otherwise, they will be real-time.
NEXT_PUBLIC_REALTIME_NOTIFICATIONS=false # Disable real-time notificationsIf 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.
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.