Skip to main content

TypeScript

The TypeScript SDK can be installed with npm, pnpm, bun, or yarn.
npm install @factify/sdk
The SDK is published with both CommonJS and ES Modules (ESM) support.

Requirements

  • Node.js 18+ or compatible runtime (Bun, Deno)
  • TypeScript 4.7+ (optional, but recommended)

Python

The Python SDK can be installed with pip, uv, or poetry.
pip install factify
If the package isn’t yet published to PyPI, use the GitHub installation method.

Requirements

  • Python 3.8+

Basic Setup

import { Factify } from "@factify/sdk";

const factify = new Factify({
  bearerAuth: process.env.FACTIFY_KEY,
});

// You're ready to make API calls
const result = await factify.documents.list();

Configuration Options

const factify = new Factify({
  // Required
  bearerAuth: process.env.FACTIFY_KEY,

  // Optional
  serverURL: "https://api.factify.com",  // Custom endpoint
  timeoutMs: 30000,                       // Request timeout (ms)
  retryConfig: {                          // Retry configuration
    strategy: "backoff",
    backoff: {
      initialInterval: 1,
      maxInterval: 50,
      exponent: 1.1,
      maxElapsedTime: 100,
    },
  },
  debugLogger: console,                   // Enable debug logging
});
Debug logging will reveal secrets like API tokens in log output. Only use during local development.

Verify Installation

Test your installation with a simple API call:
import { Factify } from "@factify/sdk";

const factify = new Factify({ bearerAuth: process.env.FACTIFY_KEY });

async function verify() {
  const docs = await factify.documents.list({ pageSize: 1 });
  console.log("Connection successful!");
}

verify();