Sending Client Logs on Non-enterprise netlify account
isaac-martin opened this issue · 1 comments
isaac-martin commented
Hey - I have followed the setup instructions but any logs sent clientside are not flowing through to axiom.
This is locally, and also on non-enterprise netlify.
- I can verify the rewrites are being added to my next config (and when going to the rewrites url
/_axiom/logs
i get a not-found api response rather than my 404 page which i guess is from sending aGET
request to an API that is expectingPOST
- These log error messages are not running https://github.com/axiomhq/next-axiom/blob/main/src/withAxiom.ts#L31, which leads me to believe that all variables are correctly there
- My
AXIOM_TOKEN
andAXIOM_DATASET
are both set and validated they are there - Logs in api routes work
- There are no network calls to the
/_axiom/logs
endpoint from my frontend
Any ideas? Seems like theres a few others having this problem but it looks like in v 0.17
it was stable in non vercel platforms?
isaac-martin commented
To do this client side you need to expose your env variables. Can do via adding them to the env property in next.config
https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables
env: {
AXIOM_TOKEN: process.env.AXIOM_TOKEN,
AXIOM_DATASET: process.env.AXIOM_DATASET,
},