Skip to content

[@hono/oauth-providers] [X/Twitter] Outdated users fields and scope #1439

@nhanht-varmeta

Description

@nhanht-varmeta

Which middleware is the feature for?

[@hono/oauth-providers]

What is the feature you are proposing?

https://docs.x.com/x-api/users/get-my-user#parameter-user-fields
https://docs.x.com/fundamentals/authentication/oauth-2-0/authorization-code#scopes
Here’s a clean description you could use for this issue report:

The library’s type definitions for Twitter API scopes, user fields, and expansions are outdated compared to the current Twitter API specification.

  • Scopes: The library does not include users.email and media.write, which are now officially supported.
  • User fields: Several fields such as affiliation, confirmed_email, connection_status, is_identity_verified, parody, profile_banner_url, receives_your_dm, subscription, subscription_type, and verified_followers_count are missing.
  • Expansions: The affiliation.user_id expansion is not available in the library types.

Because of this mismatch, developers cannot request newer scopes/fields/expansions without workarounds, and in some cases, API calls (such as /2/users/me) may fail with 403 Forbidden if unsupported fields or scopes are requested.

Expected Behavior

The library should provide up-to-date type definitions that match the latest Twitter API documentation, ensuring that all available scopes, user fields, and expansions are supported.

Suggested Fix

  • Add missing scopes (users.email, media.write)
  • Add missing user fields (affiliation, confirmed_email, etc.)
  • Add missing expansions (affiliation.user_id)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions