NFT Checkout

Initialize the widget

You can integrate the Wert Widget into your web app using our SDK, this is the recommended way to initialize the widget. For React projects, we provide this wrapper.

You can find examples of the integration on GitHub.


💡

Did you know?

Our NFT checkout can also be used for smart contract interactions such as token purchases, just omit the extra object. Check out our example on Github.


Once SDK is installed, you can use the following code snippet to initialize the payment module:

// Import the SDK
import WertWidget from "@wert-io/widget-initializer";

// Initialize the payment module
const wertWidget = new WertWidget({
  // Configuration options
  // ...
});

// Further code to handle widget events and interactions
https://sandbox.wert.io/YOUR_PARTNER_ID/widget/order?address=0x96D5990185022212d367A0e09263B12Dbb4EE06A&commodity=ETH&network=sepolia&commodity_amount=0.005&sc_address=0x3b2305502bd6f8b1eb2ed474ac15c61c6702b18b&sc_input_data=0x9dae76ea000000000000000000000000000000000000000000000000000000000000003700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001&signature=D4383F7ACB2FC8D0AF6467FE1C4B2D9821A6311EBEB967ED8729C2CC6B1A669D16DED09C4B2A215DFA15F084CAD36F8AA6F671F78BE7076494BBDF1FD2A4BD04&click_id=d5f9f6dc-4772-4146-b348-327df6df2e9c&widget_layout_mode=Modal&commodity_id=eth_sepolia.sc.ethereum&currency=USD

Options

Here are the options you can pass to the widget.

General options

PropertyRequiredDescriptionData TypeDefault valuePossible values
partner_idYesProvided when you register as a partner.string--
originIn sandboxInitializes the module in a sandbox/production environment.stringhttps://widget.wert.iohttps://sandbox.wert.io
click_idNoUnique identifier for the order, which helps you track it.string-uuid_v4()
redirect_urlNoIt includes a button 'Back to {Partner Name}' on the widget (not available in iFrame mode).
It also redirects users from KYC emails to proceed with payment.
URL string (with protocol)-https://origin.us/item_id
listenersNoYou can use this if you want to listen to some module events and react to them.object-See the listeners object.

Smart contract options

PropertyRequiredDescriptionData TypeDefault valuePossible values
sc_addressYesThe address of the smart contract.string--
sc_input_dataYesInput data that will be used for the smart contract execution (in hex format).

For Tezos, this must be Michelson code passed as JSON transformed into hex format.
string-See Forming input data
signatureYesA digital signature encrypts the request, ensuring you have sent it. The private key stored on your backend signs the request, and the public key saved in our system decrypts it.string-See Generate signed data

Pre-filled user data

PropertyRequiredDescriptionData TypeDefault valuePossible values
addressNoUser’s wallet address. It is validated based on the chosen commodity. If the address is invalid, this option is ignored. BTC address format is used as default.stringBTC-
commodityNoDefault crypto asset that will be selected in the module.stringBTCSee Supported coins and blockchains
networkNoNetwork for the default crypto asset.stringbitcoinSee Supported coins and blockchains
commodity_amountNoThe default crypto amount that will be pre-filled in the module. This option is ignored if currency_amount is set.numeric--
commoditiesNoCrypto assets that will be available in the module as a stringified JSON of an array of objects with the commodity and network options.stringBy default, all assets will be displayed.See Supported coins and blockchains
currency_amountNoThe default amount, in fiat, which will be pre-filled in the module.
Minimum value is $1.50 on sandbox and $5 on prod.
numeric--
country_of_residenceNoUser’s country of residence.string-alpha2 code of the country
state_of_residenceNoUser’s state of residence (for USA).string-alpha2 code of USA state
date_of_birthNoUser’s date of birth.string-DD/MM/YYYY
MM/DD/YYYY (USA)
emailNoUser’s email address.string-[email protected]
full_nameNoThe user’s first and last name.string-min 3, max 69 letters; RegExp(/(\\w+\\s)\\w+/)
phoneNoUser’s phone number in international format (E. 164 standard). The ‘+’ is optional.string-+11014321111

Widget customization

PropertyRequiredDescriptionData TypeDefault valuePossible values
langNoLanguage of the widget.stringenen - for English
fr - for French
skip_init_navigationNoBy default, the module suggests the nearest purchase route based on given parameters. Setting to ‘true’ skips this logic.booleanundefinedtrue
themeNoModule’s theme color.stringundefineddark
buttons_border_radius
secondary_buttons_border_radius
NoCustom radius of elements (in pixels).numeric4-
color_background
color_buttons
color_buttons_text
color_secondary_buttons
color_secondary_buttons_text
color_main_text
color_secondary_text
color_icons
color_links
color_success
color_warning
color_error
NoColor customization of specific elements of the Wert module.string-red
#FF0000
rgb(255,255,0)
is_crypto_hiddenNoIt hides crypto mentions and exchange rates. Please reach out to us to enable this feature for you.

Check boolean usage below.
booleanundefinedtrue
is_warranty_disabledNoIt turns off the NFT warranty option for a specific widget mount, even if it is enabled for your partner ID and smart contract.

Check boolean usage below.
booleanundefinedtrue

Boolean usage

So that you know, any value passed to a property with the boolean type is considered true.
Example: is_crypto_hidden: "test" is equal to is_crypto_hidden: true.