Authenticator

tmdb-js/authentication. Authenticator

Handles authentication methods of TMDb.

Constructor

new Authenticator(apiKey)

Initializes this object.
Source:
Parameters:
Name Type Description
apiKey string The TMDb API key.

Methods

(async) createGuestSessionAsync() → {Promise.<string>}

Creates a guest session.
Source:
Returns:
Type:
Promise.<string>
A Promise of a guest session ID.

(async) createLoginSessionAsync(username, password) → {Promise.<string>}

Creates a session with the passed TMDb username and password.
Source:
Parameters:
Name Type Description
username The username.
password The password.
Returns:
Type:
Promise.<string>
A Promise of a session ID string (undefined if the operation is not successful).

(async) createSessionAsync(permissionApp) → {Promise.<string>}

Creates a session. This will open a tab in the specified web browser, where the end-user will have to approve the request token and thereafter get a session ID.
Source:
Parameters:
Name Type Description
permissionApp string The name of the web browser app that the end-user will use to approve the request token. The default value is undefined. An example of a valid value is "chrome".
Returns:
Type:
Promise.<string>
A Promise of a session ID string (undefined if the operation is not successful).

(async) deleteSessionAsync(sessionId) → {Promise.<boolean>}

Deletes (log outs from) a session.
Source:
Parameters:
Name Type Description
sessionId string The ID of the session that will be deleted.
Returns:
Type:
Promise.<boolean>
A Promise of a boolean value, which will be true if the deletion is successful.