How to store my ChatGPT API Keys securely?

I made a sweet little ChatGPT Widget with Javascript …but don’t want to store my personal OpenAI key in the .js file.

can I use Variables in js files somehow?

Thanks

J

@Pakic may I kindly ask you: any ideas, still need help before I can take this live…

Website is
https://kupla24.divhunt.website/anmelden

Thanks a lot in advance

Jens

@JayKay

It’s not possible in the JavaScript, if you make it that way, everyone will see it.

Only using REST API you can make HTTP requests with secret keys and be safe that no-one will see them.

Hey Stefan @Pakic,

thanks for the answer, good point!

I’ll now try to do just that. What’s the best way to connect my Javascript with the divhunt rest api plugin/module?
I need to figure out how to get information out of the the divhunt system via Javascript.

Are there any previously recorded videos or documentation that come to your mind?

Thank you thank you thank you!!

Jens

PS: I love what you and the team built. I have a lot to learn but it went all well, so far.

Hi, also looking forward to getting tutorials on how to use REST API with javascript to send data outside Divhunt securely.
@dejan any documentation we could look at?

@dejan I followed your suggestion, tried REST API module approach. Thanks for the tip!

Looks GOOD, I can send (static for now) data to my airtable directly.

BUT could you please provide info how exactly I would trigger the REST API module through Javascript.