Fathom TypeScript SDK
The `fathom-typescript` package is Fathom's official TypeScript SDK, providing programmatic access to the Fathom External API. It allows developers to interact with Fathom meetings, teams, and team members, including operations like listing meetings, retrieving recording summaries and transcripts, and managing webhooks. The current stable version is 0.0.37. As an official SDK, it is actively maintained and designed to stay in sync with the Fathom API, though semantic versioning might not be strictly followed before a 1.0 release. It offers both CommonJS and ES Modules support, making it versatile for various JavaScript environments. Key differentiators include its direct integration with the Fathom platform and type-safe access to API resources, reducing common development errors through its comprehensive TypeScript definitions.
Common errors
-
TypeError: fathom.listMeetings is not a function
cause The `Fathom` client instance was not correctly initialized or the import path for the SDK is wrong, leading to an undefined or incorrect object.fixEnsure `import { Fathom } from "fathom-typescript";` is present and the `fathom` object is correctly instantiated with `const fathom = new Fathom({...});`. -
Error: Missing required authentication scheme `apiKeyAuth` or `bearerAuth` for security.
cause The `security` object was not provided or was incomplete during the `Fathom` client initialization, preventing proper API authentication.fixPass a valid `security` object with either `apiKeyAuth` or `bearerAuth` when creating the `Fathom` instance: `new Fathom({ security: { apiKeyAuth: process.env.FATHOM_API_KEY ?? '' } })`. -
Property 'someInvalidProperty' does not exist on type 'ListMeetingsRequest'.
cause Attempting to pass an unknown or mistyped property to an API request object, indicating a mismatch with the SDK's type definitions.fixConsult the SDK's type definitions or the Fathom API documentation to ensure all request parameters are correctly named and typed according to the API specification for the specific operation.
Warnings
- breaking As a pre-1.0 release, minor versions (`0.x.0` to `0.y.0`) and even patch versions (`0.0.x` to `0.0.y`) of `fathom-typescript` may introduce breaking API changes without strictly adhering to semantic versioning.
- gotcha Hardcoding API keys directly in source code or committing them to version control (like in the quickstart example) is a significant security risk.
- gotcha API operations that return multiple results (e.g., `listMeetings`) often implement pagination. Incorrectly handling pagination (e.g., forgetting to iterate or access subsequent pages) can lead to incomplete data retrieval.
Install
-
npm install fathom-typescript -
yarn add fathom-typescript -
pnpm add fathom-typescript
Imports
- Fathom
const Fathom = require('fathom-typescript');import { Fathom } from 'fathom-typescript'; - ListMeetingsResponse
import type { ListMeetingsResponse } from 'fathom-typescript/dist/sdk/models/operations'; - MeetingType
import type { MeetingType } from 'fathom-typescript/dist/sdk/models/shared';
Quickstart
import { Fathom } from "fathom-typescript";
const fathom = new Fathom({
security: {
apiKeyAuth: process.env.FATHOM_API_KEY ?? 'YOUR_API_KEY_HERE',
},
});
async function run() {
try {
const result = await fathom.listMeetings({
calendarInviteesDomains: [
"acme.com",
"client.com"
],
meetingType: "all",
recordedBy: [
"ceo@acme.com",
"pm@acme.com"
],
teams: [
"Sales",
"Engineering"
]
});
if (result) {
for await (const page of result) {
console.log("Retrieved meetings for page:", page);
}
} else {
console.log("No meetings found or an empty result was returned.");
}
} catch (error) {
console.error("Error listing meetings:", error);
}
}
run();