Skip to content

Comment on Show HN: Next.js ChatGPT – Responsive chat application powered by GPT-4parent

Comments

Thanks, it is good :) You don’t need the serverside though; you can just call openai apis straight from the client. Makes things easier!

It seems to support both? First it tries to load the key from a environment variable, and if it cannot, it'll ask for it client-side.

None the less, if you're building a project for others, you most likely don't want the secret key to be public, which it'd be if you embed it in the client-side code.

It seems to support both?

Ah, only saw the api one!

If you call the openai API's straight from the FrontEnd, you are likely leaking your api keys to visitors who can then use your api keys (and api key limits) for their own purposes.

Nah, you ask them to enter their own; if you use yours, then yes, only use backend. In this case, the author is not using his, you have to bring your own, so frontend is fine.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.