loup
loup
NNovu
Created by loup on 11/8/2024 in #💬│support
Best way to sync subscribers settings with Postgres database
There is my solution. Ive created an ExpressJS api to make communicate my backend (Supabase) with Novu. And inside this express if create a worflow with the new code based method, there is an example :
export const guidelistSentWorkflow = workflow('guidelist_sent', async ({ payload, step, subscriber }) => {
await step.inApp('notify-in-app', () => ({
subject: translationService.translate('guidelist.sent.in_app.subject', subscriber.locale),
body: translationService.translate('guidelist.sent.in_app.body', subscriber.locale, {
userUsername: payload.sender.username,
movieTitle: payload.movie.title,
movieSlug: payload.movie.slug
}),
avatar: payload.sender.avatar || undefined,
redirect: {
url: `/collection/guidelist#${payload.id}`
}
}));

await step.push('notify-push', () => ({
subject: translationService.translate('guidelist.sent.push.subject', subscriber.locale),
body: translationService.translate('guidelist.sent.push.body', subscriber.locale, {
userUsername: payload.sender.username,
movieTitle: payload.movie.title
}),
}));
}, {
tags: ['guidelist'],
payloadSchema: z.object({
id: z.number().int().describe('The ID of the guidelist'),
sender: z.object({
username: z.string().describe('The user who sent the guidelist'),
avatar: z
.string()
.nullable()
.optional()
.describe('The avatar of the user who sent the guidelist')
}),
movie: z.object({
title: z.string().describe('The movie that was recommended'),
slug: z.string().describe('The slug of the movie that was recommended')
}),
})
});
export const guidelistSentWorkflow = workflow('guidelist_sent', async ({ payload, step, subscriber }) => {
await step.inApp('notify-in-app', () => ({
subject: translationService.translate('guidelist.sent.in_app.subject', subscriber.locale),
body: translationService.translate('guidelist.sent.in_app.body', subscriber.locale, {
userUsername: payload.sender.username,
movieTitle: payload.movie.title,
movieSlug: payload.movie.slug
}),
avatar: payload.sender.avatar || undefined,
redirect: {
url: `/collection/guidelist#${payload.id}`
}
}));

await step.push('notify-push', () => ({
subject: translationService.translate('guidelist.sent.push.subject', subscriber.locale),
body: translationService.translate('guidelist.sent.push.body', subscriber.locale, {
userUsername: payload.sender.username,
movieTitle: payload.movie.title
}),
}));
}, {
tags: ['guidelist'],
payloadSchema: z.object({
id: z.number().int().describe('The ID of the guidelist'),
sender: z.object({
username: z.string().describe('The user who sent the guidelist'),
avatar: z
.string()
.nullable()
.optional()
.describe('The avatar of the user who sent the guidelist')
}),
movie: z.object({
title: z.string().describe('The movie that was recommended'),
slug: z.string().describe('The slug of the movie that was recommended')
}),
})
});
To manage translation I have a dictionnaries (en-US.json, fr-FR.json, ...). And the language depend of the user language. Is it a good configuration ?
9 replies
NNovu
Created by loup on 11/15/2024 in #💬│support
How delete all activity feed items from Production env ?
Ive to delete them but even if the api response is good 201, they stay in in-app notification idk why
4 replies
NNovu
Created by loup on 11/13/2024 in #💬│support
How use FCM push in NextJS app
OKay we have to set device token : https://docs.novu.co/integrations/providers/push/fcm#setting-device-token But how sync every token with every user ?
4 replies
NNovu
Created by loup on 11/13/2024 in #💬│support
Error trying to sync to cloud (code based workflow)
its working with node 22. Im facing to another issue :
{
"statusCode": 400,
"timestamp": "2024-11-13T10:22:17.860Z",
"path": "/v1/bridge/sync?source=studio",
"message": "Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.",
"error": "Bad Request"
}
{
"statusCode": 400,
"timestamp": "2024-11-13T10:22:17.860Z",
"path": "/v1/bridge/sync?source=studio",
"message": "Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.",
"error": "Bad Request"
}
I was thinkg novu framework automatically handle the signature header, docs :
The Novu-Signature header included in each signed event contains a timestamp and one or more signatures that we verify. The timestamp is prefixed by t=, and each signature is prefixed by a scheme. Schemes start with v, followed by an integer. Currently, the only valid live signature scheme is v1.

Handling the signature verification is done by the Novu Framework, so you don’t need to perform any action.
The Novu-Signature header included in each signed event contains a timestamp and one or more signatures that we verify. The timestamp is prefixed by t=, and each signature is prefixed by a scheme. Schemes start with v, followed by an integer. Currently, the only valid live signature scheme is v1.

Handling the signature verification is done by the Novu Framework, so you don’t need to perform any action.
16 replies
NNovu
Created by loup on 11/13/2024 in #💬│support
Error trying to sync to cloud (code based workflow)
okay I need to make a custom Dockerfile (I was using nixpack), Im gonna check that thx a lot !
16 replies
NNovu
Created by loup on 11/13/2024 in #💬│support
Error trying to sync to cloud (code based workflow)
Im using Coolify btw for hosting my express api (idk if it change something)
16 replies
NNovu
Created by loup on 11/13/2024 in #💬│support
Error trying to sync to cloud (code based workflow)
node -v v18.20.2
16 replies
NNovu
Created by loup on 11/13/2024 in #💬│support
Error trying to sync to cloud (code based workflow)
Wait its my local version I should test on my VPS
16 replies
NNovu
Created by loup on 11/13/2024 in #💬│support
Error trying to sync to cloud (code based workflow)
v23.1.0
16 replies
NNovu
Created by loup on 11/13/2024 in #💬│support
Error trying to sync to cloud (code based workflow)
Im using this one "@novu/framework": "^2.4.0",
16 replies
NNovu
Created by loup on 11/10/2024 in #💬│support
TypeError: undefined is not an object (evaluating 'navigator.locks.request')
Im using 14.2.16
7 replies
NNovu
Created by loup on 11/7/2024 in #💬│support
Is Novu right for me?
Okay but a solution for me (Im a student so I cant afford the Buisness or Enterprise plan) is to only set a {{message}} in content of in-app and manage manually when triggering the notification ? I also have an idea for the transaltion of in-app and data consistency. If instead of clean msg I store an json. Like this :
{
message: "{{user}} send you a friend request",
user: "myidea"
avatar: "user.avatar_url"
}
{
message: "{{user}} send you a friend request",
user: "myidea"
avatar: "user.avatar_url"
}
And when I receive that I can make an api request too my db to get data. I can also do that for translating the message :
{
action: "FriendRequest"
}
{
action: "FriendRequest"
}
ANd getting the action message with the right locale
7 replies
NNovu
Created by loup on 11/10/2024 in #💬│support
TypeError: undefined is not an object (evaluating 'navigator.locks.request')
Im using NextJS btw
7 replies
NNovu
Created by loup on 11/10/2024 in #💬│support
TypeError: undefined is not an object (evaluating 'navigator.locks.request')
I web page in mobile (like with PWA)
7 replies
NNovu
Created by loup on 11/8/2024 in #💬│support
Best way to sync subscribers settings with Postgres database
Btw, when Novu send a notification, its raw msg right ? I means by that. Imagine I have translation for each notification. The user have as main language 'en-US'. So he receive an english notification. But 2 days later he change to 'fr-FR', the previous notifications wouldnt be translated right ?
9 replies
NNovu
Created by loup on 11/8/2024 in #💬│support
Best way to sync subscribers settings with Postgres database
Im using Supabase as backend so my idea is when user table is updated, I launch an edge function which gonna update the subscriber in Novu
9 replies
NNovu
Created by loup on 11/7/2024 in #💬│support
Is Novu right for me?
No description
7 replies
NNovu
Created by loup on 11/7/2024 in #💬│support
Is Novu right for me?
Thank you for your response. Honestly, I'm not sure where to start when it comes to adding a notification system to my NextJS app. I especially have trouble understanding how in-app notifications work. Without any examples, I'm a bit in the dark. I was considering managing notifications directly in my Postgres database with associated tables. Each time a new row is added to the notifications tables, I would call Novu to trigger either push notifications or emails based on the user’s preferences. However, since Novu also offers in-app notifications, I'm a bit lost. Specifically, how does translation work for in-app notifications? Let’s say the user has their preferences set to English and receives in-app notifications, then changes their language setting. Will the previously received notifications be translated into the new language? Thanks again!
7 replies
DTDrizzle Team
Created by readitron on 3/4/2024 in #help
How to reference supabase auth user?
I currently have a Supabase database with lot of function, trigger, and RLS. How did u add Drizzle with schema without overwritting your RLS, etc... I dont wanna loose all my work if Drizzle overwrite my setup
9 replies
DTDrizzle Team
Created by readitron on 3/4/2024 in #help
How to reference supabase auth user?
but Im quite confusing with Drizzle. For example in supabase, for making RLS we can check the auth() connected for checking if he got right to access. But is it a custom function made by Supabase ? Or Drizzle can know which user is connected for making the righ RLS (like with NextAuth) ? Sry if isnt clear. Im searching a way to be able in a futur to move away from Supaabse without a lot of changes
9 replies