Examples

Common usage patterns and recipes for Verani.

Architecture

Verani uses a per-connection architecture where each user gets their own Durable Object (ConnectionDO). RoomDOs coordinate membership and broadcasting via RPC.

Use createConnectionHandler() and createRoomHandler() for this pattern.

Authentication Note

Examples marked with:

  • Public - No authentication required (anyone can connect)
  • Authenticated - Requires token verification
  • Authorized - Requires authentication + role/permission checks

For production apps, always use authenticated examples. See Security Guide - Authentication for implementation details.

Examples

Related Documentation