Tenant admin

What an app builder does with the management API, on the demo’s own tenant. The server reads it with a read-only org API key that never reaches your browser, so nothing here can be changed.

  • Synq Demo holders: At least 1 USDC. Off, for 0 apps and 0 brands
  • Synq Demo Lounge: One of: At least 1 NFT from Seeker Genesis Token; At least 1 SKR. On, for 1 apps and 0 brands
  • Seeker Lounge: One of: At least 1 NFT from Seeker Genesis Token; At least 1 SKR. On, for 1 apps and 0 brands
src/examples/admin/TokenGates.tsx
import { demoOrg } from '../../lib/management'

// The org's token gates: an app, or a whole brand, admits only people whose
// wallets meet a rule (tokens, NFTs of a collection, one NFT, a list, as
// "all of" and "any of"), which Synq checks at sign-in. `summary` is the
// rule in words. A person who doesn't meet it sees why, and can add the
// wallet that does.
export async function TokenGates() {
  const tenant = await demoOrg()
  if (!tenant) return <p>The demo tenant isn’t set up.</p>
  const { data } = await tenant.synq.get('/v1/orgs/{org}/token-gates', {
    path: { org: tenant.org.id },
  })
  return (
    <ul aria-label="Token gates">
      {data.map((gate) => (
        <li key={gate.id}>
          <strong>{gate.name}</strong>: {gate.summary}. {gate.enabled ? 'On' : 'Off'}, for{' '}
          {gate.apps.length} apps and {gate.brands.length} brands
        </li>
      ))}
    </ul>
  )
}