Interface: PatreonOauthClientOptions
Defined in: rest/v2/oauth2/client.ts:136
Client options for handling Oauth
Extends
OauthClientOptionsPartial<Oauth2RedirectOptions>
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
accessTokenUri? | string | Overwrite the access token Oauth route Default 'https://patreon.com/api/oauth2/token' | OauthClientOptions.accessTokenUri |
authorizationUri? | string | Overwrite the authorization Oauth route Default 'https://patreon.com/oauth2/authorize' | OauthClientOptions.authorizationUri |
clientId | string | null | The client id of the application. Can be found in the Patreon developer portal. Must be defined for oauth requests (such as refreshing a token). | OauthClientOptions.clientId |
clientSecret | string | null | The client secret of the application. Can be found in the Patreon developer portal. Keep this private! Must be defined for oauth requests (such as refreshing a token). | OauthClientOptions.clientSecret |
onTokenValidationRefreshed? | (token) => void | Promise<void> | When validateToken is enabled, this callback is called when a token is refreshed by the library. Default undefined | OauthClientOptions.onTokenValidationRefreshed |
redirectUri? | string | The redirect uri to use for oauth authentication | Oauth2RedirectOptions.redirectUri |
scopes? | string[] | The scopes to request on an oauth redirect uri | Oauth2RedirectOptions.scopes |
state? | string | The state param to set on an oauth redirect uri | Oauth2RedirectOptions.state |
token? | Oauth2ClientOptionsToken | Set the (creator) token of the application. If no epoch time (ms) is given, it will assume the token was just created. | OauthClientOptions.token |
tokenType? | "creator" | "oauth" | null | The type of token is used. Used when validating resources with the given scopes. This is an option that is configured by using a creator or user client and is only needed to configure when using a custom client. Default - 'creator' when using a creator client - 'oauth' when using an user client | OauthClientOptions.tokenType |
validateScopes? | boolean | "warn" | Whether to validate all requests on Oauth clients before sending to check if the correct scopes are given. If the token type is 'creator', scope validation will be skipped for this client. Options: - false: disable validation - true: throw on missing scopes for queries - 'warn': log message on missing scopes for queries Default false | OauthClientOptions.validateScopes |
validateToken? | boolean | Check if the token is given and not expired before running a request. If the token is an object and is expired, the client will refresh the token, update the cached token (cachedToken property) and use the refreshed token to make an API request. Use onTokenValidationRefreshed to listen to these updates. Default false | OauthClientOptions.validateToken |