What is UseBetter Console?
UseBetter Console is a completely optional self-hosted backend that connects your app to the Console UI at console.usebetter.dev. No data leaves your infrastructure — the UI runs in your browser and all API calls go directly to your server via /.well-known/better/* endpoints.
Key features
Section titled “Key features”- Optional — not required for any UseBetterDev product. Add it when you want a visual admin dashboard.
- No data leaves your server — the hosted UI at
console.usebetter.devis a static frontend. It makes API calls to YOUR server only. - 5-minute setup — one middleware, one CLI command, and you’re connected.
- Multiple auth methods — auto-approve for development, magic link for production.
- Permission-based access — three levels (
read,write,admin) with a hierarchical model. - Product endpoint registration — UseBetterDev products (like UseBetter Tenant) that the Console UI discovers automatically.
- CORS-restricted by default — only
console.usebetter.devcan call your console endpoints. Add custom origins if needed.
How it works
Section titled “How it works”- Add the middleware — mount
createConsoleMiddleware()in your Hono app. It intercepts/.well-known/better/*requests. - Set the token hash — run
npx @usebetterdev/console-cli initto generate a connection token. Store the hash in your environment. - Open the Console UI — visit
console.usebetter.devand enter your server URL (e.g.,https://myapp.com). - Authenticate — the UI calls your server’s session endpoints. In development, auto-approve issues a token instantly. In production, magic link sends a 6-character code to your email.
- Manage via registered endpoints — once authenticated, the UI discovers your registered products and presents their data through typed endpoints.
Architecture
Section titled “Architecture”| Layer | Package | Role |
|---|---|---|
| Core | @usebetterdev/console | Config, session management, routing, CORS. Zero runtime deps. |
| Drizzle adapter | @usebetterdev/console/drizzle | Session and magic link storage via Drizzle ORM. |
| Hono middleware | @usebetterdev/console/hono | Thin adapter between Hono Request/Response and Console. |
| CLI | @usebetterdev/console-cli | Token generation, migration SQL, setup verification. |
You install the main package (@usebetterdev/console) and import adapters via subpath exports. The CLI is a separate package used via npx.
Next steps
Section titled “Next steps”- Installation — install the package and its peer dependencies
- Quick Start — connect your app to UseBetter Console in 5 minutes