🍿 @lorenzopant/tmdb

Validate Key

Test your API key or Bearer token to confirm it is valid.

Sends a request to GET /authentication to verify that the access token used to initialise the client is valid. Useful as a quick sanity check at startup or after credential rotation.

async validate_key(): Promise<AuthValidateKeyResponse>

TMDB Reference: Validate Key

Parameters

None.

Returns

AuthValidateKeyResponse

Errors

HTTPTMDB codeCause
4017Invalid or expired API key / Bearer token.

Example

import { TMDB } from "@lorenzopant/tmdb";

const tmdb = new TMDB("your-access-token");
const result = await tmdb.authentication.validate_key();

console.log(result.success); // true
console.log(result.status_message); // "Success."

On this page