Is it safe to declare Parse app id and server url on client side JS?

Viewed 153

For example is it safe to put this in my .js file that's client side.

Parse.initialize("myAppId");
Parse.serverURL = 'https://0fc98698cc.ngrok.io/1'
2 Answers

Yes, as the docs say, it is safe to use the YOUR_APP_ID, YOUR_JAVASCRIPT_KEY and YOUR_PARSE_SERVER URL on the client side, but NOT the YOUR_MASTERKEY.

Parse.initialize("YOUR_APP_ID", "YOUR_JAVASCRIPT_KEY", "YOUR_MASTERKEY");
//javascriptKey is required only if you have it on server.

Parse.serverURL = 'http://YOUR_PARSE_SERVER:1337/parse'

It is totally safe to expose your APP_ID and SERVER_URL. App ID only identify your parse applications if you are hosting more than one parse app on your node process. For instance, if you are mounting more than 1 parse server to an express application, you use different app ids and mounting points.

Related