API Tokens for HyperSync
Overview
API tokens provide authenticated access to HyperSync services, enabling enhanced capabilities and usage tracking. While currently optional, they will become mandatory in the future and offer significant advantages for serious usage.
Starting from 9 April 2025, you will still be able to use HyperSync without API tokens, but rate limits will be applied. The service will remain free to use until the end of April. From May onwards, we will introduce a set of tiered packages based on usage. Indexers deployed to our hosted service will have special access to HyperSync that does not require a custom API token.
Table of Contents
Benefits of Using API Tokens
Using API tokens with HyperSync provides several advantages:
- Dedicated Resources: Access to reserved capacity and bandwidth
- Performance Guarantees: Higher quality of service with better reliability
- Usage Analytics: Track and monitor your consumption patterns
- Future-Proofing: Early adoption before tokens become mandatory
- Enhanced Support: Better visibility for troubleshooting assistance
Generating API Tokens
You can generate API tokens through the Envio Dashboard:
- Visit https://envio.dev/app/api-tokens
- Sign in to your account (or create one if you don't have one)
- Follow the prompts to create a new token
- Copy and securely store your token
Implementation Guide
To use an API token, pass it as a bearer_token
when creating a HyperSync client:
- TypeScript/JavaScript
- Python
- Rust
const client = HypersyncClient.new({
url: "https://eth.hypersync.xyz",
bearerToken: process.env.HYPERSYNC_BEARER_TOKEN,
});
client = hypersync.HypersyncClient(hypersync.ClientConfig(
url="https://eth.hypersync.xyz",
bearer_token=os.environ.get("HYPERSYNC_BEARER_TOKEN")
))
let client = Client::new(ClientConfig {
bearer_token: Some(std::env::var("HYPERSYNC_BEARER_TOKEN").unwrap_or_default()),
..Default::default()
})
.unwrap();
Understanding Usage
To understand your current month's usage, visit https://envio.dev/app/api-tokens. Usage is composed of two main components:
- Number of Requests: The total count of API requests made.
- Credits: A comprehensive calculation that takes into account multiple factors including data bandwidth, disk read operations, and other resource utilization metrics. This provides the most accurate representation of actual service usage. We're happy to provide more detailed breakdowns of the credit calculation upon request.
Security Best Practices
When working with API tokens:
- Never commit tokens to git repositories
- Use environment variables to store tokens instead of hardcoding
- Add token files like
.env
to your `.gitignore - Rotate tokens periodically for enhanced security
- Limit token sharing to only those who require access
# Example .env file
HYPERSYNC_BEARER_TOKEN=your_secret_token_here
This approach keeps your tokens secure while making them available to your application at runtime.