If you want the shared web component to display inside of your web page, then you will want to use the inline method.
To use the inline method you will need to set the method to ‘inline’ and set the target to the id of div that the content should be inserted into.
<div id="inlineIntentDiv"></div>
function launchInline(){ var intent = new window.ShopIntegration.Intent( 'mitchell1.intent.action.view', 'vendor/vnd.m1.sampleintent.view.v1', '{"message": "Hello World"}', { target: 'inlineIntentDiv', method: 'inline', width: width || '100%', height: height || '100%' }; window.IntegrationManager.start(intent, token); }
If you want the shared web component to display in its own window, then you will want to use the new method.
To use the new method you will need to set the method to ‘new’.
function launchNewWindow(){ var intent = new window.ShopIntegration.Intent( 'mitchell1.intent.action.view', 'vendor/vnd.m1.sampleintent.view.v1', '{"message": "Hello World"}', { method: 'new', width: width || '100%', height: height || '100%' }; window.IntegrationManager.start(intent, token); }