Note: All dependencies are required for full functionality of the widget across different blockchain networks and wallet types.
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
import Blockend from "@blockend/widget";
import "@blockend/widget/dist/style.css";
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
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.