Skip to main content

Relay

Project ID​

The Project ID is consumed through URL parameters.

URL parameters used:

Example URL:

https://relay.walletconnect.com/?projectId=c4f79cc821944d9680842e34466bfbd

This can be instantiated from the client with the projectId in the SignClient constructor.

import SignClient from "@walletconnect/sign-client";
const signClient = await SignClient.init({
projectId: "c4f79cc821944d9680842e34466bfb",
});

Allowlist​

Limit access to known HTTP origin.

Possible values for the origin value:

  • <scheme>://<hostname>
  • <scheme>://<hostname>:<port>
  • <scheme>://*.<hostname>

Adding https://dapp.example.com to the allowlist will only allow requests from that origin. Requests from other origins will be denied. Using localhost (or 127.0.0.1) is also always permitted. Updates take 15 minutes to apply.

Error Codes​

ReasonError Code
Project ID doesn't exist OR JWT is expired401
Exists and is invalid403
Too many requests1013

Websocket Close Codes​

CodeDescriptionReconnect
1001Server terminatingYes
4008Client stale: connected without a prior subscription and is not sending dataWhen needed
4010Load RebalancingYes

Best Practices​

  • Create a new projectId for each project. This allows for more granular control, dedicated explorer listings, and project metrics.
  • Don't reuse a projectId.
  • Use the AllowList to limit unauthorized usage.
  • Avoid committing projects keys to the repo. Use env variables instead.