0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

NextJs フロントサイド .env 値の取得方法

Posted at

NextJs フロントサイド .env 値の取得方法

こちらの記事に書いてある通り
NextJs ver9.4以上であれば

.env
NEXT_PUBLIC_TEST=next_public_test

のように先頭にNEXT_PUBLICを付けることで
フロントサイドにて
process.env.NEXT_PUBLIC_TEST
で値を取得可能。

開発環境ごとの.envを扱いたい場合は
こちらの記事を参考にしましょう!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?