Faucet Flow
Pre-built and customizable flow for interacting with token faucets on test networks.
Faucet Flow
The Faucet flow provides a complete interface for requesting test tokens from faucets on Avalanche test networks.
Backend Requirements
The Faucet flow requires a backend API to handle token distribution and rate limiting. You'll need to implement the following endpoints:
We provide an example implementation using Next.js API routes, but you can use any backend technology. Note that the example implementation uses in-memory storage and is for demonstration purposes only. For production use, you should:
- Implement persistent storage for request tracking
- Add proper rate limiting per address/IP
- Include security measures (API keys, CORS, etc.)
- Handle concurrent requests appropriately
- Manage token distribution limits
Basic Usage
Configuration
Required Props
Prop | Type | Description |
---|---|---|
chainId | number | ID of the test network |
tokens | Token[] | List of supported tokens |
Token Configuration
Each token in the tokens
array should have the following structure:
Optional Props
Prop | Type | Default | Description |
---|---|---|---|
className | string | - | Additional CSS classes |
Features
The Faucet flow includes:
- Token selection interface
- Balance display
- Request handling
- Status tracking
- Timeout management
Building Custom Flows
The Faucet flow exposes individual components that you can use to build your own custom faucet interface:
Last updated on