Search posts, tags, users, and pages
Grace Frank
What if I want to use env variables, will I define it differently from the frontend?
Mary Etokwudo
Hi Grace! When you add the prefix NEXT_PUBLIC_ to your env variables, Next.js will make it available on the browser. For example:
NEXT_PUBLIC_
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID='your_google_analytics_id'
Note that it is not advisable to expose sensitive variables to the browser. Let me know if this works or not :)