A user authentication token manager.

Hierarchy

Constructors

Properties

bearerToken: string
fetch: {
    (input, init?): Promise<Response>;
    (input, init?): Promise<Response>;
}

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: RequestInfo | URL
      • Optional init: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

      • input: string | Request | URL
      • Optional init: RequestInit

      Returns Promise<Response>

guestCreatedAt?: Date
guestToken?: string
jar: CookieJar
options?: Partial<TwitterAuthOptions>

Methods

  • Returns the time that authentication was performed.

    Returns null | Date

    The time at which the authentication token was created, or null if it hasn't been created yet.

  • Parameters

    • data: TwitterUserAuthFlowRequest

    Returns Promise<FlowTokenResult>

  • Parameters

    • prev: FlowTokenResultSuccess

    Returns Promise<FlowTokenResult>

  • Parameters

    • prev: FlowTokenResultSuccess
    • email: undefined | string

    Returns Promise<FlowTokenResult>

  • Parameters

    • prev: FlowTokenResultSuccess
    • email: string

    Returns Promise<FlowTokenResult>

  • Parameters

    • prev: FlowTokenResultSuccess
    • password: string

    Returns Promise<FlowTokenResult>

  • Parameters

    • prev: FlowTokenResultSuccess
    • username: string

    Returns Promise<FlowTokenResult>

  • Parameters

    • prev: FlowTokenResultSuccess

    Returns Promise<FlowTokenResult>

  • Parameters

    • prev: FlowTokenResultSuccess

    Returns Promise<FlowTokenResult>

  • Parameters

    • prev: FlowTokenResultSuccess
    • secret: string

    Returns Promise<FlowTokenResult>

  • Returns if the authentication state has a token.

    Returns boolean

    true if the authentication state has a token; false otherwise.

  • Returns Promise<FlowTokenResult>

  • Parameters

    • headers: Headers$1

    Returns Promise<void>

  • Installs the authentication information into a headers-like object. If needed, the authentication token will be updated from the API automatically.

    Parameters

    • headers: Headers$1

      A Headers instance representing a request's headers.

    Returns Promise<void>

  • Returns if a user is logged-in to Twitter through this instance.

    Returns Promise<boolean>

    true if a user is logged-in; otherwise false.

  • Logs into a Twitter account.

    Parameters

    • username: string

      The username to log in with.

    • password: string

      The password to log in with.

    • Optional email: string

      The email to log in with, if you have email confirmation enabled.

    • Optional twoFactorSecret: string

    Returns Promise<void>