Steps to follow for migrating to SDK 2
Step 1
Replace the Mindset SDK 1.0 file name mindset-sdk.js by mindset-sdk-2.js
The MINDSET-SDK-URL is also a new URL (not anymore your mindset AI app URL).
Replace MINDSET-SDK-URL with the URL provided by Mindset AI.
Step 2
Add the <mindset-agent> HTML tag in your HTML body
Step 3
Remove the javascript code that uses the SDK 1.0 methods (initApp() and render() or startAgentThread()). Your existing script should look like this:
Step 4
Wrap your existing code in charge of fetching the authToken from your back-end script into an async method:
Step 5
Pass your function to the mindset.init() method
If you would like further information on how details of the parameters are passed, please take a look at our API specifications here.