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.

  1. api_key.expired
  2. user.created
  3. discord_role.recognized
  4. api_key.expired
  5. brand.deleted
  6. brand.deleted
  7. api_key.revoked
  8. app.created
  9. file.uploaded
  10. file.uploaded
  11. file.uploaded
  12. app.created
  13. file.uploaded
  14. file.uploaded
  15. app.created
  16. file.uploaded
  17. file.uploaded
  18. app.created
  19. file.uploaded
  20. file.uploaded
  21. file.uploaded
  22. token_gate.updated
  23. app.created
  24. brand.updated
  25. brand.updated
src/examples/admin/AuditLog.tsx
import { demoOrg } from '../../lib/management'

// The org's audit log, newest first: every change anyone made through the
// dashboard or the API, and every sign-in event, with who did it. The same
// rows reach the org's webhooks as events.
export async function AuditLog() {
  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}/audit-log', {
    path: { org: tenant.org.id },
    query: { limit: 25 },
  })
  return (
    <ol aria-label="Audit log" className="space-y-2">
      {data.map((event) => (
        <li key={event.id}>
          <time dateTime={event.created_at}>{new Date(event.created_at).toUTCString()}</time>{' '}
          <code>{event.action}</code>
        </li>
      ))}
    </ol>
  )
}