Delete Session
Invalidate a session ID to log a user out.
Invalidates an existing session ID, effectively logging the user out. After this call, the session ID can no longer be used for account operations.
async delete_session(body: AuthDeleteSessionBody): Promise<AuthDeleteSessionResponse>TMDB Reference: Delete Session
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
session_id | string | ✅ | The session ID to invalidate. |
Returns
Errors
| HTTP | TMDB code | Cause |
|---|---|---|
| 401 | 3 | Invalid or missing access token. |
| 401 | 7 | Invalid or already-deleted session ID. |
Example
import { TMDB } from "@lorenzopant/tmdb";
const tmdb = new TMDB("your-access-token");
const { success } = await tmdb.authentication.delete_session({
session_id: "79191836ddaa0da3df76a5ffef6f07ad6ab0c641",
});
console.log(success); // true