Back

Quick question about Web SDK

  • 0
  • General
  • Web
Kanashimo.
29 Jul, 2023, 19:32

It is good to put all my js code created with web sdk to file e.g index.php wich is visible for all site viewers

TL;DR
The user has a question about using OAuth2 via Web SDK. They mention separating files and hiding sensitive information from others. It is recommended to use environment variables and different code files to protect sensitive credentials. The user suggests putting all JavaScript code created with the Web SDK in a file like "index.php" that is visible to all site viewers. However, this is not recommended for security reasons.
joeyouss
29 Jul, 2023, 19:46

It is generally not recommended to include all your code, especially sensitive SDK credentials, in a file that is visible to all site viewers. Doing so can expose your Appwrite API keys or other sensitive information, making it vulnerable to potential security risks.

That is why I personally recommend working with env variables and different code files.

Kanashimo.
29 Jul, 2023, 19:48

Ok so make env file that is not readable to other but for js is

joeyouss
29 Jul, 2023, 19:50

ye or just separate your files. you would also need to think if everyone can access your code (if it's open source), how you can hide the important stuff which shouldn't be shared

Kanashimo.
29 Jul, 2023, 21:48

Oh and I have one more question

Kanashimo.
29 Jul, 2023, 21:49

I can do oauth2 via web sdk

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more