Skip to content

Add option to disable Telegram user fields for OIDC-only usage #16

@flxxxxddd

Description

@flxxxxddd

Problem

When using better-auth-telegram with only the OIDC provider (oauth.telegram.org) and without the Telegram Login Widget or Mini App features, the plugin still injects user schema fields telegramId, telegramUsername, and telegramPhoneNumber. This forces additional columns in the user model and migrations even though they are unused for the OIDC flow. It increases DB surface area and complicates adoption for teams that only need OIDC.

Proposed Solution

Add a configuration flag (e.g., schema: { includeUserFields: false } or oidcOnly: true) that prevents the plugin from adding user schema fields (telegramId, telegramUsername, telegramPhoneNumber) when only OIDC is used. The account fields used for OAuth linking can remain if needed, but user-level Telegram fields should be optional and disabled by default in OIDC-only mode. Include docs and an example showing OIDC-only setup without extra user columns.

Alternatives Considered

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions