Skip to content
Search
Search the documentation
OAuthAuthorizeQuery
GitHub GitHub

OAuthAuthorizeQuery

Interface: OAuthAuthorizeQuery

Defined in: v1/types/oauth.ts:37

Query parameters for sending a user to the Top.gg OAuth authorization page.

  • GET https://top.gg/oauth2/authorize

See

https://docs.top.gg/oauth/authorization

Properties

client_id

client_id: string

Defined in: v1/types/oauth.ts:41

Your OAuth app’s client ID.


code_challenge

code_challenge: string

Defined in: v1/types/oauth.ts:65

PKCE challenge: base64url(sha256(code_verifier)) without padding, where code_verifier is a random string of 43 to 128 characters.

See

https://datatracker.ietf.org/doc/html/rfc7636


code_challenge_method

code_challenge_method: "S256"

Defined in: v1/types/oauth.ts:69

Must be S256.


platform?

optional platform?: ProjectPlatformType

Defined in: v1/types/oauth.ts:78

Platform for platform_id, e.g. discord. Use both together when you know the external ID but not the Top.gg project ID.


platform_id?

optional platform_id?: string

Defined in: v1/types/oauth.ts:83

External ID on platform, e.g. a Discord bot ID. The matching project is preselected on the consent screen, same behavior as project_id. Unknown IDs are ignored.


project_id?

optional project_id?: string

Defined in: v1/types/oauth.ts:73

Top.gg project ID to preselect on the consent screen. The user can change the selection.


redirect_uri

redirect_uri: string

Defined in: v1/types/oauth.ts:49

One of the redirect URIs registered for your application. Must match exactly.


response_type

response_type: "code"

Defined in: v1/types/oauth.ts:45

Must be code.


scope

scope: string

Defined in: v1/types/oauth.ts:53

The scopes to request, space-separated. Request only what your application uses.


state

state: string

Defined in: v1/types/oauth.ts:58

An opaque value you generate per authorization request. Echoed back unchanged on the callback - verify it to prevent CSRF.