Add notifications feature and update feature flags
This update includes creating new files for the notifications feature along with adding two feature flags for enabling notifications and realtime notifications. All the code and package dependencies required for the notifications functionality have been added. The 'pnpm-lock.yaml' has also been updated due to the inclusion of new package dependencies.
This commit is contained in:
@@ -40,6 +40,18 @@ const FeatureFlagsSchema = z.object({
|
||||
description: `If set to user, use the user's preferred language. If set to application, use the application's default language.`,
|
||||
})
|
||||
.default('application'),
|
||||
enableNotifications: z
|
||||
.boolean({
|
||||
description: 'Enable notifications functionality',
|
||||
required_error: 'Provide the variable NEXT_PUBLIC_ENABLE_NOTIFICATIONS',
|
||||
})
|
||||
.default(true),
|
||||
realtimeNotifications: z
|
||||
.boolean({
|
||||
description: 'Enable realtime for the notifications functionality',
|
||||
required_error: 'Provide the variable NEXT_PUBLIC_REALTIME_NOTIFICATIONS',
|
||||
})
|
||||
.default(true),
|
||||
});
|
||||
|
||||
const featuresFlagConfig = FeatureFlagsSchema.parse({
|
||||
@@ -74,6 +86,14 @@ const featuresFlagConfig = FeatureFlagsSchema.parse({
|
||||
languagePriority: process.env.NEXT_PUBLIC_LANGUAGE_PRIORITY as
|
||||
| 'user'
|
||||
| 'application',
|
||||
enableNotifications: getBoolean(
|
||||
process.env.NEXT_PUBLIC_ENABLE_NOTIFICATIONS,
|
||||
true,
|
||||
),
|
||||
realtimeNotifications: getBoolean(
|
||||
process.env.NEXT_PUBLIC_REALTIME_NOTIFICATIONS,
|
||||
false,
|
||||
),
|
||||
} satisfies z.infer<typeof FeatureFlagsSchema>);
|
||||
|
||||
export default featuresFlagConfig;
|
||||
|
||||
Reference in New Issue
Block a user