Guild.xyz Access Control
Gate Discord roles, Telegram groups, and token-gated content by on-chain Cron Protocol subscription status using Guild.xyz.
Overview
Guild.xyz lets you create token-gated communities where access is verified on-chain. Cron Protocol's built-in /api/guild/subscription-check endpoint allows Guild to verify whether a wallet has an active subscription to your plan — in real time.
How it works
- A user tries to join your Guild
- Guild calls your dashboard API with the user's wallet address
- The API reads the subscription status from the CronRegistry contract
- Guild grants or denies access based on the
{ "access": true }response
API endpoint
bash
GET https://app.cronprotocol.xyz/api/guild/subscription-check
?address=0xUSER_WALLET
&planId=1
&chain=base # optional: base | baseSepolia (default: base)Response:
json
{ "access": true }Setting up a Guild role
- Go to guild.xyz and create or edit a Guild
- Add a role → Add requirement → API call
- Set the URL to:bash
https://app.cronprotocol.xyz/api/guild/subscription-check?planId=YOUR_PLAN_ID&chain=base - Expected response key:
access - Expected value:
true
[i] Real-time verification
Guild re-checks access each time a member tries to perform a gated action, so subscription cancellations automatically revoke access without any manual intervention.
Testing the endpoint
bash
curl "https://app.cronprotocol.xyz/api/guild/subscription-check?address=0xYOUR_WALLET&planId=1&chain=baseSepolia"
# → { "access": true }Self-hosted usage
The route is part of the dashboard Next.js app at src/app/api/guild/subscription-check/route.ts. If you run your own dashboard, Guild will call your deployment URL instead.
[*] Multiple plans
Create a separate Guild role requirement for each plan ID. This lets you gate different tiers of access — e.g. Basic (plan 1) vs Pro (plan 2) — in the same Guild.