Installation
Install the React package and its peer dependencies:Peer Dependencies
The package requires the following peer dependencies:Package Overview
The@drift-labs/react package provides:
- Providers:
DriftProviderandDriftWalletProviderfor app-wide state management - Hooks: Custom hooks for interacting with Drift Protocol
- Components: Reusable UI components (Charts, Tables, Loaders, etc.)
- Stores: Zustand-based state management for Drift data
- Actions: Common actions for Drift operations
Quick Start
Here’s a minimal setup to get started:Environment Configuration
The package automatically initializes the Drift store with environment settings. You can customize these through theDriftProvider:
TypeScript Support
The package is fully typed with TypeScript. All exports include type definitions:What’s Exported
The package exports everything you need from a single entry point:Next Steps
Wallet Integration
Connect wallets and manage user authentication
Drift Provider
Configure the DriftProvider for your app
Using Hooks
Learn about available hooks and how to use them
Custom Components
Build custom components with Drift data