Overview
thunder-core is the official Thunder plugin adding auth, RBAC, multi-tenancy, OAuth2/OIDC, a double-entry wallet, API keys, email, and more.
thunder-core is the official Thunder plugin. It turns the minimal framework into a batteries-included backend by adding authentication, an OAuth2 / OpenID Connect provider, role-based access control (RBAC), multi-tenancy, a double-entry wallet/ledger, API keys, transactional email, ImageKit upload auth, and database-backed environment variables.
It installs like any other plugin:
deno task add:plugin -n Huruf-Tech/thunder-coreWhat's Included
Authentication
better-auth sessions, API keys, and OAuth bearer tokens via withAuthSession.
Multi-Tenancy
Isolated workspaces, members, and invites resolved with withTenant.
Access Control (RBAC)
Permission-gated routes by default via the guard hook and withAuthGuard.
OAuth2 Provider
Authorization Code + PKCE, refresh tokens, and ID tokens.
API Keys
Hashed API keys authenticated via the X-Api-Key header.
Wallet & Ledger
Integer-cent, double-entry wallet with idempotency and refunds.
Email & Uploads
Handlebars-templated SMTP email and ImageKit upload auth.
Routes & Schemas
Shipped routes, hooks, and the full collection list.
Import Path Convention
Once installed, thunder-core lives under plugins/Huruf-Tech/thunder-core/. Its routes, hooks, schemas, lib, utils, scripts, and public files are copied into your project and its routes/hooks are auto-discovered and merged into the app.
Consumer-facing utilities are imported via the @/ alias:
import { withAuthSession } from "@/plugins/Huruf-Tech/thunder-core/utils/withAuthSession.ts";
import { withTenant } from "@/plugins/Huruf-Tech/thunder-core/utils/withTenant.ts";
import { Wallet } from "@/plugins/Huruf-Tech/thunder-core/lib/wallet.ts";Source files are the authoritative spec. This documentation describes behavior, concepts, and gotchas that are not obvious from the code. For exact routes, request/response shapes, and model fields, read the referenced source files inside plugins/Huruf-Tech/thunder-core/ - they are always the up-to-date source of truth.
Next Steps
Install the plugin, then run its setup lifecycle to create indexes and seed the default RBAC roles before you start building.