Make authenticated RPC requests
After you bind a public key to a Nodes API key, each RPC request must include both credentials:
- The Nodes API key in the endpoint URL path.
- The signed JSON Web Token (JWT) in the
Authorization: Bearer <JWT>header.
Copy the HTTP endpoint URL from the Endpoints tab for your Nodes API key. The copied URL includes the API key path. Set the URL and a freshly generated token as environment variables:
If you need a token, generate a JWT first.
Send a request
These examples call eth_blockNumber and print the JSON-RPC response.
Save the example as request.ts or request.go.
Run the example:
A successful response contains the latest block number in the result field.
Refresh tokens before they expire
Issue short-lived tokens from your backend and replace them before exp. Never embed the private key or token-generation code in a browser app. If several clients share a token, refresh it early enough that active requests don’t cross the expiration time.
Troubleshoot authentication errors
If Conduit rejects a request, check that:
- The endpoint URL contains the correct Nodes API key.
- The
Authorizationheader uses theBearer <JWT>format. - The JWT hasn’t expired.
- The JWT header’s
kidmatches the Key ID shown in Conduit. - The JWT algorithm matches the algorithm selected for the public key.
- The public key is enabled and bound to the API key in the endpoint URL.
For other HTTP and JSON-RPC failures, use the RPC error reference.