#HTTP 400 when using `novu.subscribers.setCredentials()` in SvelteKit

1 messages · Page 1 of 1 (latest)

lethal bough
#

I'm using SvelteKit, and I get a 400 error when trying to set up a user to be able to push to a Discord webhook.

// $lib/server/novu.ts
import { DISCORD_WEBHOOK, NOVU_API_KEY } from "$env/static/private";
import { Novu, ChatProviderIdEnum } from "@novu/node";

export const novu = new Novu(NOVU_API_KEY)

await novu.subscribers.setCredentials('officialDiscord', ChatProviderIdEnum.Discord, {
    webhookUrl: DISCORD_WEBHOOK
})

And here is the error:

Error: Request failed with status code 400
    at createError (/home/teo/gasp/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/teo/gasp/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/home/teo/gasp/node_modules/axios/lib/adapters/http.js:322:11)
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
cunning nova
#

<@&986960430528331776> please have a look here