Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an .env.example for NextJS #20

Merged
merged 3 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions example-servers/nextjs/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Do not share your API key with anyone! It should remain a secret.
OPENAI_API_KEY=key-here
HUGGING_FACE_API_KEY=key-here
STABILITY_API_KEY=key-here
COHERE_API_KEY=key-here
4 changes: 3 additions & 1 deletion example-servers/nextjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ If you want to use the proxy functions:

<b>Local</b> - Replace the environment variables (`process.env.`) in the route handler functions with the corresponding API key values. E.g. if you want to use the OpenAI Chat, replace [`process.env.OPENAI_API_KEY`](https://github.com/OvidijusParsiunas/deep-chat/blob/d2fdd06dabbf30f3bd318c37e37dce99650d60f3/example-servers/nextjs/pages/api/openai/chat.ts#L24) with a string value of the key.

<b>Hosting Platform</b> - Add the environment variables to your deploy config. E.g. if you want to use the OpenAI Chat, add the `OPENAI_API_KEY` environment variable.
<b>Hosting Platform</b> - Add the environment variables to your deploy config. E.g. if you want to use the OpenAI Chat, add the `OPENAI_API_KEY` environment variable.
OvidijusParsiunas marked this conversation as resolved.
Show resolved Hide resolved

To do this you can create an `.env.local` file in the root of the `nextjs` folder and define the corresponding environment variables. E.g. if you want to use OpenAI API, define the `OPENAI_API_KEY` variable. See the `.env.example` file.

### :wrench: Improvements

Expand Down