N
Novu3mo ago
NDOT

Notifications provided by useNotifications() Hook is undefined

notifications provided by useNotifications() Hook is undefined but when i click on bell icon(<NotificationBell />) it is defined so i suppose it is being lazily loaded for the reference i have attached two images first one is before clicking bell icon and one is after . I want to access notifications is there any other way to do so?
No description
No description
34 Replies
Pawan Jain
Pawan Jain3mo ago
@NIKHILHARISINGHANI Can you please share the code snippet
NDOT
NDOT3mo ago
No description
NDOT
NDOT3mo ago
No description
NDOT
NDOT3mo ago
I am just printing the notifications
Pawan Jain
Pawan Jain3mo ago
@NIKHILHARISINGHANI Please share the complete code snippet how you are using this hook
NDOT
NDOT3mo ago
No description
Pawan Jain
Pawan Jain3mo ago
<Fourth /> component has useNotifications hook I see you are using <PoppverNotificationCenter /> component
NDOT
NDOT3mo ago
No i just wanted to print notifications
Novu_Bot
Novu_Bot3mo ago
@NIKHILHARISINGHANI, you just advanced to level 1!
NDOT
NDOT3mo ago
I have found a way to render notifications how do i update my state in real time Is there any event emitted to which i can listern to?
NDOT
NDOT3mo ago
Can we increase number of notifications while using useNotification?
Pawan Jain
Pawan Jain3mo ago
@NIKHILHARISINGHANI I would recommend you to use useFetchNotifications() instead https://docs.novu.co/inbox/react/api-reference#usefetchnotifications
Pawan Jain
Pawan Jain3mo ago
It has limit option
NDOT
NDOT3mo ago
Also can i use it in cloudflare workers? If i expose /api/novu in cf worker would that work Can you get back on thi ASAP
Pawan Jain
Pawan Jain3mo ago
Also can i use it in cloudflare workers?
Are you looking to use react notification center in cloudflare workers?
NDOT
NDOT3mo ago
no I wanted to use backend sdk with cf worker Seems like i cant do it
{
"url": "https://novutest.onrender.com/api/novu",
"statusCode": 401,
"retryCount": 0,
"message": "Unauthorized",
"raw": {
"message": "Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.",
"code": "SignatureMismatchError"
}
}
{
"url": "https://novutest.onrender.com/api/novu",
"statusCode": 401,
"retryCount": 0,
"message": "Unauthorized",
"raw": {
"message": "Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.",
"code": "SignatureMismatchError"
}
}
i keep getting this error idk y Hey can you please help me asap?? I was working fine earlier
v [Error]: Something went wrong. Please try again later.
at Object.post (C:\Practice\Node2\node_modules\@novu\framework\dist\servers\express.js:23:5035)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async C:\Practice\Node2\node_modules\@novu\framework\dist\servers\express.js:27:4763
at async ce.handleAction (C:\Practice\Node2\node_modules\@novu\framework\dist\servers\express.js:27:3924)
at async C:\Practice\Node2\node_modules\@novu\framework\dist\servers\express.js:27:2816 {
data: undefined,
statusCode: 500,
code: 'BridgeError'
}
v [Error]: Something went wrong. Please try again later.
at Object.post (C:\Practice\Node2\node_modules\@novu\framework\dist\servers\express.js:23:5035)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async C:\Practice\Node2\node_modules\@novu\framework\dist\servers\express.js:27:4763
at async ce.handleAction (C:\Practice\Node2\node_modules\@novu\framework\dist\servers\express.js:27:3924)
at async C:\Practice\Node2\node_modules\@novu\framework\dist\servers\express.js:27:2816 {
data: undefined,
statusCode: 500,
code: 'BridgeError'
}
And now this error
Novu_Bot
Novu_Bot3mo ago
@NIKHILHARISINGHANI, you just advanced to level 2!
Pawan Jain
Pawan Jain3mo ago
@NIKHILHARISINGHANI Checking with team on this @NIKHILHARISINGHANI I tried to make POST http request to https://novutest.onrender.com/api/novu. I am getting the same error Can you please check if novu secret key (api key) is correctly set? and this endpoint is public?
NDOT
NDOT3mo ago
Yes checked both Idk after almost an hour it started working
Pawan Jain
Pawan Jain3mo ago
It could be env variable issue
I wanted to use backend sdk with cf worker
Currently we don't support CF worker. Sharing this with team to add it into our roadmap Is this a blocker for you to use Novu V2? or you are just testing it on CG worker?
NDOT
NDOT3mo ago
I was tetsing it on Node Environment Also was trying on local studio I was getting 400 and 500 error Dk why Was working fine earlier
Pawan Jain
Pawan Jain3mo ago
@NIKHILHARISINGHANI Just want to check if it is working as expected now?
NDOT
NDOT3mo ago
It is working Bro idk i am getting 400 error in local studio workflow testing Any solution It was working fine earlier Even after succesful sync i dont see changes in dashboard
NDOT
NDOT3mo ago
No description
NDOT
NDOT3mo ago
I have implemented everything correctly Please getback asap @Pawan Jain curl -X POST 'https://api.novu.co/v1/events/trigger' \ -H 'Authorization: ApiKey NOVU_SECRET_KEY' \ -H 'Content-Type: application/json' \ -d '{ "name": "push-notification-workflow", "to": { "subscriberId": "66a25b5bf502999ed8c9b36b", "email": "[email protected]" }, "payload": { "body": " nn", "title": "n", "__source": "studio-test-workflow" } }'
Novu_Bot
Novu_Bot3mo ago
@NIKHILHARISINGHANI, you just advanced to level 3!
NDOT
NDOT3mo ago
Please check api key is used correctly Also in local studio i keep getting 400
NDOT
NDOT3mo ago
stuck here for 2mins and then i get 500
No description
NDOT
NDOT3mo ago
Please check whats wrong
Pawan Jain
Pawan Jain3mo ago
Do you see error description in console or network tab? Can you share the steps to reprodcu this?
NDOT
NDOT3mo ago
i am trying in new environment But when i inspected It said to field is undefined or null Also geeting error after deploying it says signature mismatch
NDOT
NDOT3mo ago
the url is perfectly fine
No description
NDOT
NDOT3mo ago
Idk why this is not working Hey
Want results from more Discord servers?
Add your server