Install Widget Pro

Getting started with Blockend Widget

Blockend Widget is available as an npm package along with several required dependencies for full functionality.

Package Dependencies Overview

The widget requires the following dependency packages:

  • @dynamic-labs: Provides wallet connection for Solana blockchain.

  • @cosmjs: Enables interaction with Cosmos-based blockchains

  • graz: Provides react hooks for Cosmos wallet interaction.

  • wagmi,viem: Enables interaction with EVM blockchain

Installation Commands

Choose your preferred package manager:

npm:

npm install @blockend/widget @blockend/compass-sdk wagmi viem @tanstack/react-query @dynamic-labs/sdk-react-core @dynamic-labs/solana @dynamic-labs/bitcoin graz graz-sh/types @cosmjs/cosmwasm-stargate @cosmjs/proto-signing @cosmjs/stargate

yarn:

yarn add @blockend/widget @blockend/compass-sdk wagmi viem @tanstack/react-query @dynamic-labs/sdk-react-core @dynamic-labs/solana @dynamic-labs/bitcoin graz graz-sh/types @cosmjs/cosmwasm-stargate  @cosmjs/proto-signing @cosmjs/stargate 

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

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:

Customise Widget Pro

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?