Sui RPC Quickstart | ERPC

Sui RPC Quickstart

This guide takes you from zero to a configured Sui gRPC-web transport with ERPC.

1. Get Your API Key

You can obtain and check your API key on the ERPC Web Dashboard: ERPC Web Dashboard
Already using ERPC for Solana, Ethereum, or Avalanche? You can use the same RPC key.

2. Configure the gRPC-web Transport

Sui is served over binary gRPC-web (application/grpc-web+proto), one unary call per HTTP request. Configure a GrpcWebFetchTransport with the ERPC base URL and your API key as a Bearer token:
typescript
import { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport'

const transport = new GrpcWebFetchTransport({
  baseUrl: 'https://sui.erpc.global', // or https://edge.erpc.global/sui
  format: 'binary',
  meta: { Authorization: 'Bearer <YOUR_API_KEY>' },
})
Pass this transport to the unary service client generated for the Sui gRPC API. The client appends /sui.rpc.v2.<Service>/<Method> to baseUrl, for example /sui.rpc.v2.LedgerService/GetServiceInfo. Because the SDK appends the path to the base URL, the API key goes in the Authorization header instead of the api-key query parameter.
Only unary calls over binary gRPC-web are supported. JSON-RPC requests, native gRPC, text-format gRPC-web, and streaming are not.

Next Steps