Onmeta Widget Integration
Widget Creation

Customizing widget

4min
since widget has optional parameters that can be set during initialisation, let's see what are parameters that can be configured with it and how to enable offramp functionality as well by default widget will be initialised with onramp feature and default fiat is only inr , for php contact our sales team to enable it and from widget initialize fiattype\ php for php 1\ offramp only offramp can be enabled by setting the flag to offramp "enabled" offramp "enabled" as shown in below example \<script> &#x9;let createwidget = new onmetawidget({ elementid "widget", // mandatory (it should be an id of an element not a class) apikey "api key", // mandatory useremail "test\@test com", // optional (if passed user don't have to register in meta platform) chainid "80001", // optional (it should be passed along with the tokenaddress to show a particular token to the user) tokenaddress "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // optional offramp "enabled", // to enable offramp feature onramp "disabled" // to disable onramp feature }); createwidget init(); // it will initialize the widget inside the particular div element \</script> 2\ offramp and onramp both on and off ramp can be enabled by setting respective flags to a value as enabled enabled as shown below \<script> &#x9;let createwidget = new onmetawidget({ elementid "widget", // mandatory (it should be an id of an element not a class) apikey "api key", // mandatory useremail "test\@test com", // optional (if passed user don't have to register in meta platform) chainid "80001", // optional (it should be passed along with the tokenaddress to show a particular token to the user) tokenaddress "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // optional offramp "enabled", // to enable offramp feature onramp "enabled" // to enable onramp feature }); createwidget init(); // it will initialize the widget inside the particular div element \</script> 3\ to set default input type as crypto in offramp widget sellcryptotype "coins" //initialise this parameter within widget object to get crypto as input by default