Skip to main content

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);
ParameterTypeDescription
apikeyStringStores and verifies the API key for using the SDK and identifies the user
InitOptionObjectYou can enter additional user information for SDK users

InitOption

ParameterTypeDescription
userAgeStringCustomer age range
userGenderStringCustomer'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>