Install Widget Pro
Getting started with Blockend Widget
Blockend Widget is available as an npm package.
npm:
yarn:
Integrating widget to your dapp or webiste is very easy. It takes a full 3 line of code to integrate and start using Blockend Widget, now that's a lot of work for a human dev.
1. Import Widget dependencies
In your react app, start by importing the Blockend Widget and its styles
You may encounter Server Error... ReferenceError: self is not defined in your Next JS app, this is because blockend requires web apis to work and the web apis are not available on the server side when next js renders a page, in order to avoid this you can start by importing the Blockend Widget like below
2. Initialize the Widget
Add the widget component to your app
Integrator Id (Required)
Unique identifier assigned to each integration partner. It is used to track and manage various integrations within our system.Error will be thrown if this field is empty.
This id will be added in the request header of api calls that is made by the widget.
And that is it, you have successfully integrated the Blockend Widget.
3. (optional) Customizing the Widget
As an optional step, you can also customize the look and feel of the widget. This can be done by passing a configuration object as prop when initializing the widget.
Full list of configuration options can be found here:
Code Example
Here is what a integration of widget on your frontend might look like:
Supported Tokens
Widget supports a whole array of token which would be difficult to list here, so we have built a handy API just for that
You can also pass chainId
as query parameter to get tokens for a specific chain
You can also get list of supported chains by calling the following endpoint
Last updated
Was this helpful?