Docs Icon ChevronRight For Developers Icon ChevronRight Getting Started

Getting Started

The Fuel Wallet SDK serves as a connection manager between your DApp and other wallets compatible with the Fuel Network. This package ensures that you can connect to the Fuel Wallet as well as any other wallet using a unified API.

If you are using React jump to the React section Icon Link.

Installation

To begin integrating the Fuel Wallet SDK into your DApp, you first need to install the packages @fuel-wallet/sdk and fuels.

1npm install @fuel-wallet/sdk fuels

The installation also requires the fuels SDK, as it is used to communicate with the Fuel Network and provides a set of utilities required for interacting with contracts on the Fuel Network.

Example

1import { Fuel } from '@fuel-wallet/sdk';
2
3const fuel = new Fuel();
4
5await fuel.connect();

Using React

We also provide a set of React hooks and a UI for working with it connectors without, the need for manually create a UI, for it.

Installation

1npm install @fuels/react fuels

Example

Setup

Wrap your application with the provider FuelConnectProvider.

1import { FuelProvider } from '@fuels/react';
2
3ReactDOM.createRoot(document.getElementById('root')!).render(
4  <React.StrictMode>
5    <FuelProvider>
6      <App />
7    </FuelProvider>
8  </React.StrictMode>
9);

Alternatively, you can use just the FuelProvider if you prefer not to use the provided UI.

Usage

1import { useConnectUI } from '@fuels/react';
2const { connect, isConnecting } = useConnectUI();
3
4<button onClick={connect}>
5  {isConnecting ? 'Connecting...' : 'Connect'}
6</button>

Check our example application for a quick start Icon Link.