SDK
SDK Parameters
syntax the js sdk is initialized using this syntax socratease init(clientid, jsonpayload, hmacpayload, options); clientid the socratease client id is one half of a key pair that identifies your socratease property ( definitions docid 7dwbpbpjxuvh38h r2hel ) the client id can be made public jsonpayload the payload is a set of parameters payload docid 7cy1qkswkezcp719c1vu that you want to initialize the library with this will contain information such as the user details, what component you want the library to load and so on you need to pass the payload as a json hmacpayload because the socratease sdk is a client side library, your end user can see the code and can manipulate it for example, they could open up the code in their browser's "inspect" window, and change the username to someone else's to protect against this, we need to ensure that the payload the socratease library receives is what you, as the website owner, want to send us hmac authentication is how we achieve this you can read about it in our page on hmac authentication, but the basic idea is that you compute the hash of the json payload using a secret key that you receive when you create your account you will store this secret key in your backend and will use it to compute the hmac of the payload when the socratease backend receives any request, it will compute the hmac of the payload, and check that it matches what was provided to the sdk because only your backend knows the secret key, if your end user manipulates the payload, they will not be able to generate the correct hmac and their request will return a 403 error options use this to customize the behaviour of socratease for example, you may want to inject the socratease dom into a certain div or, you may want to use your own navbar instead of the socratease navbar learn more here options docid\ y71gy6d17 sulyuo5jwve