axiomhq/next-axiom

Improving definition of AxiomRequest type

francofantini opened this issue · 3 comments

Currently, the AxiomRequest type is defined as follows:

export type AxiomRequest = (NextRequest | Request) & { log: Logger };

However, this definition poses difficulties when trying to use Next.js-specific APIs like req.nextUrl, which are not available in the Request type.

I propose updating the AxiomRequest type to the following:

export type AxiomRequest = NextRequest & { log: Logger };

This change will ensure that the AxiomRequest type aligns with Next.js APIs.

Please let me know if I'm missing any important considerations or if you have any suggestions for alternative solutions.

Thank you

hey @francofantini, lets give it a shot. I am not sure though when does Next.js passes NextRequest and when does it pass a normal Request.

Thanks @schehata! When can we expect the next npm release?

hi @francofantini will check on Monday, if there is any other open issues or features we would like to implement, and I will get back to you. will try to release this week.