What's new
loginWidget option (#16)
loginWidget?: boolean (default true). Set to false to disable Login Widget endpoints and omit Telegram-specific schema fields. OIDC-only setups no longer get 5 unused database columns cluttering their schema.
telegram({
botToken: "...",
botUsername: "...",
loginWidget: false,
oidc: { enabled: true, clientSecret: "..." },
})Zero breaking changes — undefined defaults to true.
Modular refactoring
src/index.ts (747 LOC monolith) split into 6 focused modules. Same public API, same behaviour, now actually maintainable.
| File | Purpose |
|---|---|
plugin-config.ts |
Config parsing + validation |
schema.ts |
Conditional user/account fields |
config-endpoint.ts |
GET /telegram/config |
widget-endpoints.ts |
signIn, link, unlink |
miniapp-endpoints.ts |
Mini App signIn, validate |
index.ts |
Thin orchestrator (~85 LOC) |
Tests
261 → 329 tests. 100% statement/line/function coverage. Every branch in every extracted module exercised.
Also
loginWidgetEnabledin config response- Rate limits now conditional (only registered when the corresponding flow is active)
- Fixed incorrect cross-provider comments in endpoint handlers
npm install better-auth-telegram@1.5.0
Full Changelog: v1.4.0...v1.5.0