node-ttv
Version:
A Node.js wrapper for Twitch.tv's helix API.
52 lines (51 loc) • 2.17 kB
TypeScript
import Scopes from './Scopes';
/**
* Handle your application's OAuth 2.0 credentials
*/
export default class OAuth {
/**
* Your application's client id
*/
readonly CLIENT_ID: string;
/**
* Your application's secret
*/
readonly SECRET: string;
/**
* Create a new handle for OAuth 2.0 credentials
* @param clientID Your application's client id
* @param secret Your application's secret
*/
constructor(clientID: string, secret: string);
/**
* Fetch your app's App Access Token.
* Used for queries that are not user-specific.
* @returns Your app's App Access Token
*/
appAccessToken(): Promise<string>;
/**
* OAuth implicit code flow link
* @params See Twitch.tv's documentation here: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth
* @returns A link to give your users for authentication
*/
implicitUserAccessToken(redirectURI: string, scopes: Scopes[], force_verify?: boolean, state?: string): string;
/**
* OAuth authorization code flow link
* @params See Twitch.tv's documentation here: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth
* @returns A link to give your users for authentication
*/
authorizationUserAccessToken(redirectURI: string, scopes: Scopes[], force_verify?: boolean, state?: string): string;
/**
* OAuth implicit code flow link
* @params See Twitch.tv's documentation here: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth
* @returns A link to give your users for authentication
*/
static implicitUserAccessToken(clientID: string, redirectURI: string, scopes: Scopes[], force_verify?: boolean, state?: string): string;
/**
* OAuth authorization code flow link
* @params See Twitch.tv's documentation here: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth
* @returns A link to give your users for authentication
*/
static authorizationUserAccessToken(clientID: string, redirectURI: string, scopes: Scopes[], force_verify?: boolean, state?: string): string;
private static getUserToken;
}