cmendoza
cmendoza
Explore posts from servers
CDCloudflare Developers
Created by cmendoza on 5/15/2024 in #pages-help
Consuming queues and defining durable objects in SvelteKit app
Hi, I have a sveltekit CF pages app that utilizes cloudflare-adapter. I recognize that we can access durable objects via the platform.env, so my questions are: 1. Is it possible to define the Durable Object instance (plus be able to set up a websocket server for it) in the same app, or should I create a separate worker for that? 2. Is it possible to consume queues? (context: since my plan is that the request will go to the queue first, then the queue will be the one calling the durable object fetch) Thanks!
3 replies
NNovu
Created by cmendoza on 9/24/2023 in #💬│support
To `data` not getting saved with the subscriber upon triggering workflow (REST API)
I'm letting a workflow trigger create new subscribers, however, there seems to be a bug where the custom data is not getting stored, see below for the curl command (the data.gender doesn't get stored in the newly created subscriber):
curl --location --request POST 'https://api.novu.co/v1/events/trigger' \
--header 'Authorization: ApiKey <REPLACE_WITH_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "user-registration",
"to": {
"subscriberId": "123456789",
"firstName": "john",
"lastName": "smith",
"data": {
"gender": "male"
}
},
"tenant": null
}'
curl --location --request POST 'https://api.novu.co/v1/events/trigger' \
--header 'Authorization: ApiKey <REPLACE_WITH_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "user-registration",
"to": {
"subscriberId": "123456789",
"firstName": "john",
"lastName": "smith",
"data": {
"gender": "male"
}
},
"tenant": null
}'
3 replies
NNovu
Created by cmendoza on 9/14/2023 in #💬│support
Triggered notification returned 201 but did not receive anything nor it showed in the activity feed
No description
11 replies
NNovu
Created by cmendoza on 9/13/2023 in #💬│support
What is the best way to remove a single deviceToken from a subscriber that has several deviceTokens
Hi, I just want to confirm what is the current best way to delete only specific tokens from the array of multiple deviceTokens of a subscriber (I'm using fcm). So far I've only tried using the REST API for updating the subscriber's credentials(https://docs.novu.co/api-reference/subscribers/update-subscriber-credentials) From my observation on how the updating the credentials work, I found that the provided deviceTokens in the requests always get added to the current list of the subscriber's deviceTokens (i.e. if the current deviceTokens is ["1","2","3"], sending a request with deviceTokens: ["4"] will make it deviceTokens: ["1","2","3","4"]), that part is actually well and good for me. (It might be worth mentioning that it conflicts with a solution that was provided on an older thread: https://discord.com/channels/895029566685462578/1073310233750933565/1073312550600577145) However, now I'm wondering what if I want to do the opposite where I want to delete specific tokens from the deviceTokens array? I observed that updating with deviceTokens: [] indeed clears out all the deviceTokens. So I'm wondering if the current best way to delete specific tokens is clearing it out first to deviceTokens: [] then doing another update credentials request to set the filtered out deviceTokens? (2 requests) (Actually my plan is eventually using the SDK instead of the REST API, but I'm assuming their behaviors should be the same, right? Let me know if otherwise.) Thanks in advance!
10 replies