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

LibraryDescription
ethers.jsComplete and compact library for Ethereum
viemModern, TypeScript-first interface for Ethereum
web3.jsThe 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.

JavaScript Integration | 256 Blocks