@geometra/auth — Example

Geometra's server is the rendering authority — it computes layout and streams geometry. @geometra/auth gates connections via token verification and gates messages via per-role policies, all at the WebSocket layer.

1 Connect as Admin — full access. Click the Increment button and watch the count update live.
2 Connect as Viewer — read-only. You see the same UI but click events are blocked by the server's role policy.
3 Invalid Token — connection refused. The server rejects the WebSocket handshake (code 4001).
Auth Events Not connected
Select a role above to connect.

How it works