JavaScript Integration
Connect to 256 Blocks using JavaScript and TypeScript
256 Blocks provides full compatibility with all major JavaScript/TypeScript Ethereum libraries. Choose the library that best fits your project's needs.
Available Libraries
| Library | Description |
|---|---|
| ethers.js | Complete and compact library for Ethereum |
| viem | Modern, TypeScript-first interface for Ethereum |
| web3.js | The original Ethereum JavaScript API |
Authentication
All JavaScript integrations use the X-API-Key header for authentication. Use your Endpoint Key from the endpoint settings screen. Each library has its own method for setting custom headers - see the individual library pages for details.
RPC Endpoint
Use the following endpoint format:
https://rpc.256blocks.com/{chain}
Supported chains include ethereum, base, arbitrum, optimism, polygon, and bsc.