Steps to follow for migrating to SDK 2.0

Step 1

Replace the Mindset SDK 1.0 file name mindset-sdk.js by mindset-sdk-2.js

<script src="YOUR-MINDSET-URL/mindset-sdk2.js"></script>

Step 2

Add the <mindset-agent> HTML tag in your HTML body

 <mindset-agent 
    initial-data=""
    style="width: 70%; height: 90%; margin: auto;">
 </mindset-agent>

Step 3

Replace the javascript code that uses the SDK 1.0 methods (initApp() and render() or startAgentThread()). Your existing script should look like this:

mindset.initApp({ 
    appUid: "YOUR-APP-UID", 
    authToken: data.authToken,     
    containerId: "agent-div",      
    loadingText: "Please wait ..." 
})

mindset.startAgentThread({
    agentUid: "YOUR-AGENT-UID",  
    initialQuestion: "Some text to send to the agent"
});

Replace the above with this javascript code which builds the <mindset-agent> initial-data attribute:

const initialData = {
    appUid: "YOUR-APP-UID",
    appName: "YOUR-APP-UID",
    component: "agent",
    authToken: authToken,
    options: JSON.stringify({
        agentUid: "YOUR-AGENT-UID",
        variables: { tenantId: "mindset." }
    })
};        

let mindsettag = document.getElementsByTagName('mindset-agent')[0];
mindsettag.setAttribute('initial-data', JSON.stringify(initialData));

Please check a full example of a SDK 2.0 front-end page here : Front-end full example