Missing authorization header

Hello Team, @novu/api is not working with me anymore, I'm getting that there is a Missing authorization header, so here is my code
import { Novu } from '@novu/api'

const novuSecretKey = process.env.NOVU_SECRET_KEY

if (!novuSecretKey) {
throw new Error('NOVU_SECRET_KEY is not set')
}

export const novu = new Novu({
secretKey: novuSecretKey,
serverURL: 'https://eu.api.novu.co',
})

export const getNovu = () => {
const key = process.env.NOVU_SECRET_KEY
console.log({
title: 'getNovu',
novuSecretKey: key,
envKey: process.env.NOVU_SECRET_KEY,
})
return new Novu({
secretKey: key,
serverURL: 'https://eu.api.novu.co',
})
}
import { Novu } from '@novu/api'

const novuSecretKey = process.env.NOVU_SECRET_KEY

if (!novuSecretKey) {
throw new Error('NOVU_SECRET_KEY is not set')
}

export const novu = new Novu({
secretKey: novuSecretKey,
serverURL: 'https://eu.api.novu.co',
})

export const getNovu = () => {
const key = process.env.NOVU_SECRET_KEY
console.log({
title: 'getNovu',
novuSecretKey: key,
envKey: process.env.NOVU_SECRET_KEY,
})
return new Novu({
secretKey: key,
serverURL: 'https://eu.api.novu.co',
})
}
in console.log, I can see clearly the key is passed correctly and in the log that is coming from novu. here is the sent header headers: Headers { accept: 'application/json', authorization: ' <NOVU_SECRET_KEY>', ....} what I noticed is in your doc it should be --header 'Authorization: **ApiKey** <NOVU_SECRET_KEY>' and from the SDK it's only NOVU_SECRET_KEY could you please help me solve this issue?
No description
16 Replies
Omar Khatib
Omar KhatibOP3mo ago
this is the error log. you can see clearly that the secretKey is being passed
Pawan Jain
Pawan Jain3mo ago
Hi Omar

Checking it from my end
Omar Khatib
Omar KhatibOP3mo ago
Hey Pawan, any update about the issue?
Novu_Bot
Novu_Bot3mo ago
@Omar Khatib, you just advanced to level 1!
Pawan Jain
Pawan Jain3mo ago
@Omar Khatib I just checked from my side. Could you please check with latest version v1.4.0
Omar Khatib
Omar KhatibOP3mo ago
It’s already v1.4
Pawan Jain
Pawan Jain3mo ago
@Omar Khatib its a bit weird issue. I checked this from my end but could not replicate. Any chance you can hop on screen sharing session if you are still facing this issue
Omar Khatib
Omar KhatibOP3mo ago
@Pawan Jain do you have any time today?
Pawan Jain
Pawan Jain3mo ago
DMing @Omar Khatib Did you get a chance to create a minimal example of honojs ?
Omar Khatib
Omar KhatibOP3mo ago
Hey Pawan, I just noticed the issue with another SDK, so I'm assuming it's Vercel, let me check before I give you the minimal repo
Pawan Jain
Pawan Jain3mo ago
Sure Omar
Omar Khatib
Omar KhatibOP3mo ago
Hey Pawan, so the other SDK, was a wrong env. not Vercel I will prepare tomorrow morning a minimal repo for you
Omar Khatib
Omar KhatibOP3mo ago
Hey Pawan, here is the Minimal reproduction: https://github.com/omarkhatibco/mando-api-minimal I also deployed it on Vercel, seperatly and tried. and still does not work I batched the global fetch to see the requests, the headers object is empty [FETCH OUT] { requestId: '14272c3e-9a96-4c05-9821-960c27c805d5', url: '[object Request]', method: 'GET', headers: undefined, body: null, timestamp: '2025-07-16T12:57:14.254Z' }
GitHub
GitHub - omarkhatibco/mando-api-minimal
Contribute to omarkhatibco/mando-api-minimal development by creating an account on GitHub.
Omar Khatib
Omar KhatibOP3mo ago
anyway, waiting for your feedback, if you need my secrect key, I could provide it to you
Pawan Jain
Pawan Jain3mo ago
Omar, able to reproduce on vercel with your repo. will keep you updated
Omar Khatib
Omar KhatibOP2mo ago
Hey Pawan, any update here?

Did you find this page helpful?