Init
Initialize the SDK for use.
This process verifies the API key, stores the user's basic information, and prepares various functions to operate.
OpmIO.init(apiKey);
Parameter | Type | Description |
---|---|---|
apikey | String | Stores and verifies the API key for using the SDK and identifies the user |
InitOption | Object | You can enter additional user information for SDK users |
InitOption
Parameter | Type | Description |
---|---|---|
userAge | String | Customer age range |
userGender | String | Customer's gender |
💡 example
<script>
!function(e,t,n,c,s,a,i){e[s]=e[s]||["init","event"].reduce(((t,n)=>({...t,[n]:function(){e[s]?.q.push([n,arguments])}})),{q:[]}),a=t.createElement(n),i=t.getElementsByTagName(n)[0],a.async=1,a.src="https://cdn.omnicommerce.ai/sdk/broswer/latest/main.js?v="+(new Date).getDate(),i.parentNode.insertBefore(a,i)}(window,document,"script",0,"OpmIO");
OpmIO.init('YOUR_PLUGIN_KEY');
</script>