Website logo
Home
Widget
API
Navigate through spaces
⌘K
Onmeta Widget Integration
🔰Getting started
🛠️Pre requisites
🏗️Widget Creation
KYC with Widget
Developer FAQs
Business FAQs
User FAQ's
How to find the UTR details?
📱Mobile SDK
KYC Webhook Configuration
Docs powered by Archbee
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" as shown in below example.

JS
<script>
	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 as shown below.

JS
<script>
	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

JS
sellCryptoType: "coins" //initialise this parameter within widget object to get crypto as input by default




Updated 02 Dec 2023
Did this page help you?
PREVIOUS
Widget Creation
NEXT
Embedding widget
Docs powered by Archbee
TABLE OF CONTENTS
1. Offramp only.
2. OffRamp and OnRamp
3. To set default input type as crypto in offramp widget
Docs powered by Archbee