Getting Started
The Torque UI library provides React components to easily integrate Torque functionality into your Solana application.
Requirements
React 18 or higher
A Solana wallet adapter implementation
Installation
Install the package:
Basic Setup
First, import the required styles in your app's entry point:
Add the TorqueProvider component to your application. The TorqueProvider must be a child of the
WalletProvider
component from the Solana wallet adapter library.
NOTE: You can get a publisher handle by logging into the Torque application and creating a publisher account.
Props
Prop | Type | Description |
---|---|---|
options | The Torque options for the provider. | |
wallet | Wallet | The wallet to use for the provider. |
autoInit | boolean | Whether to automatically initialize the user with Torque using SIWS when a wallet is detected. Defaults to |
Quick Start Guide
Here's a simple example of adding a Torque drawer to your application:
The TorqueDrawer component will add a drawer interface that shows available offers and campaigns to your users. A user will be able to:
View available campaigns
Track their progress
Complete requirements
Claim rewards
Last updated