Identity / Names·Multi-chain
Guild.xyz
Token-gated communities and roles. Membership-layer protocol that gates Discord, Telegram, GitHub, and custom platforms on token, NFT, POAP, and onchain criteria.
- 01Discord/Telegram token gating
- 02role-based community access
- 03multi-platform single-source-of-truth gating
- 04automated role syncing
- 05DAO/community membership
- pnpm add @guildxyz/sdk viem
| Variable | Scope | Description |
|---|---|---|
| GUILD_API_KEY | Server | Guild API key (requested from Guild team for higher rate limits). |
| GUILD_SIGNER_PRIVATE_KEY | Server | Private key used to sign authenticated SDK requests (server-side only). |
| NEXT_PUBLIC_GUILD_ID | Client | Numeric guild ID or url-name slug. |
Use `@guildxyz/sdk` (v2+) for membership and role gating. Instantiate the client with `createGuildClient('YourApp')` and authenticate with a viem `LocalAccount` for write operations. Read-only: `client.guild.get(guildIdOrUrlName)`, `client.guild.role.get(guildId, roleId)`, `client.user.getMemberships(address)`. Write: `client.guild.create({ name, urlName, roles, guildPlatforms }, signerFn)` where `guildPlatforms` describes Discord/Telegram targets and `roles[].requirements` defines token/NFT/POAP/balance gates. Sync user role state with `client.user.join(guildId, address, signerFn)`.
- ⚑SDK v1.x.x is deprecated and stopped working in 2024 — use the v2+ `@guildxyz/sdk` only.
- ⚑Auth uses EIP-191 personal_sign over a Guild-specific message; passing the wrong signer type silently fails with 401.
- ⚑Discord/Telegram bot must be invited to the target server with the right permissions before role-sync calls work.
- ⚑Token requirements re-check on a cooldown (typically minutes-to-hours) — instant role removal on token transfer is not guaranteed.
- ⚑Public API is rate-limited per IP; partners should request an API key for higher quotas.
- ⚑Some chains require Guild's indexer to support them — exotic L2s may have requirement check delays or be unsupported.