Is it safe to use NEXT_PUBLIC_APP_KEY for storing an API key? #3

Closed
opened 2026-02-16 06:16:22 -05:00 by yindo · 2 comments
Owner

Originally created by @savokiss on GitHub (Oct 30, 2023).

As far as I know, the NEXT_PUBLIC_ prefix is typically used for non-sensitive environment variables.

If you use this prefix to store an API key, there is a chance that it could be leaked, right?

Originally created by @savokiss on GitHub (Oct 30, 2023). As far as I know, the `NEXT_PUBLIC_` prefix is typically used for non-sensitive environment variables. If you use this prefix to store an API key, there is a chance that it could be leaked, right?
yindo closed this issue 2026-02-16 06:16:22 -05:00
Author
Owner

@crazywoola commented on GitHub (Nov 8, 2023):

See this doc

When you define Environment Variables as key-value pairs using the dashboard or Vercel CLI, they are configured outside your source code. These variables are available to your source code during the build process.

I don't think the prefix will affect the security. It's more like a convention.

@crazywoola commented on GitHub (Nov 8, 2023): See this [doc](https://vercel.com/docs/deployments/environments#managing-variables) > When you define [Environment Variables](https://vercel.com/docs/projects/environment-variables) as key-value pairs using the dashboard or Vercel CLI, they are configured outside your source code. These variables are available to your source code during the build process. I don't think the prefix will affect the security. It's more like a convention.
Author
Owner

@savokiss commented on GitHub (Nov 8, 2023):

See this doc

When you define Environment Variables as key-value pairs using the dashboard or Vercel CLI, they are configured outside your source code. These variables are available to your source code during the build process.

I don't think the prefix will affect the security. It's more like a convention.

So, As I can find my NEXT_PUBLIC_APP_KEY in the dev mode on my browser's source code, you mean if I use vercel, it won't be exposed to the browser?

@savokiss commented on GitHub (Nov 8, 2023): > See this [doc](https://vercel.com/docs/deployments/environments#managing-variables) > > > When you define [Environment Variables](https://vercel.com/docs/projects/environment-variables) as key-value pairs using the dashboard or Vercel CLI, they are configured outside your source code. These variables are available to your source code during the build process. > > I don't think the prefix will affect the security. It's more like a convention. So, As I can find my NEXT_PUBLIC_APP_KEY in the dev mode on my browser's source code, you mean if I use vercel, it won't be exposed to the browser?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/webapp-text-generator#3