Zoom API TypeScript client: zoom-api-js
v3.7.1Unofficial, fully typed TypeScript client for the Zoom API, generated from its OpenAPI spec and published to npm as zoom-api-js.
Not affiliated with or endorsed by Zoom.
Installation
npm install zoom-api-jsAuthentication
Pass a Zoom OAuth access token as the token option, or a function that refreshes it, since Zoom access tokens expire after an hour.
Examples
import { ZoomApi } from "zoom-api-js";
const client = new ZoomApi({ token: process.env.ZOOM_TOKEN ?? null });
const files = await client.api.archiving.listArchivedFiles({});const files = await client.request("GET /archive_files");const { auth } = new ZoomApi({ token: null });
let session = { accessToken: "", refreshToken: process.env.ZOOM_REFRESH_TOKEN ?? "", expiresAt: 0 };
const client = new ZoomApi({
token: async () => {
if (Date.now() >= session.expiresAt) {
const result = await auth.refreshToken({
refreshToken: session.refreshToken,
clientId: process.env.ZOOM_CLIENT_ID ?? "",
clientSecret: process.env.ZOOM_CLIENT_SECRET ?? "",
});
session = {
accessToken: result.access_token,
refreshToken: result.refresh_token,
expiresAt: Date.now() + (result.expires_in - 60) * 1000,
};
}
return session.accessToken;
},
});