A guest authentication token manager. Automatically handles token refreshes.

Hierarchy

Implements

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.

  • Returns Promise<string>

  • Returns Promise<Cookie[]>

  • Returns if the authentication state has a token.

    Returns boolean

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

  • 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.

    Returns Promise<void>

  • Parameters

    • key: string

    Returns Promise<void>

  • Returns if the authentication token needs to be updated or not.

    Returns boolean

    true if the token needs to be updated; false otherwise.

  • Updates the authentication state with a new guest token from the Twitter API.

    Returns Promise<void>