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


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.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)-
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.
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
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
NoCustom radius of elements (in pixels).numeric4-
NoColor customization of specific elements of the Wert module.string-red
is_crypto_hiddenNoIt hides crypto mentions and exchange rates. Please reach out to us to enable this feature for you.

Check boolean usage below.
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.

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.