This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
Will this work with React/Nextjs? #1
-
I am confused as to whether this is client-side code or server-side code, as if the former, the API key may be exposed. On the other hand when i tried to run it from a nextjs app it threw up all kinds of errors. |
Beta Was this translation helpful? Give feedback.
Answered by
thejamescollins
May 15, 2023
Replies: 1 comment 1 reply
-
Hi there @quacrobat, This library is intended for server-side code. OpenAI ]does not recommend](https://github.com/openai/openai-node#openai-nodejs-library) using JavaScript API client code on the client side due to exposing secret API keys. We haven't used this library ourselves with NextJS, but we have used it in a NodeJS app and a Typescript app. I hope that helps, James |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
thejamescollins
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there @quacrobat,
This library is intended for server-side code.
OpenAI ]does not recommend](https://github.com/openai/openai-node#openai-nodejs-library) using JavaScript API client code on the client side due to exposing secret API keys.
We haven't used this library ourselves with NextJS, but we have used it in a NodeJS app and a Typescript app.
I hope that helps,
James