Search code examples
javascriptparse-platform

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


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'

Solution

  • 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'