Documentation Index
Fetch the complete documentation index at: https://developers.factify.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This quickstart walks you through uploading your first document, creating a version, and generating a shareable link.
Install the SDK
Install the Factify SDK using your preferred package manager:pip install factify
# Or install from GitHub if not yet on PyPI:
# pip install git+https://github.com/factify-inc/factify-python.git
Set Your API Key
Get your API key from the Developer Dashboard and set it as an environment variable:export FACTIFY_KEY=ffy_live_xxxxxxxxxxxxxxxxxxxx
Upload a Document
Create your first document by uploading a PDF:import { Factify } from "@factify/sdk";
import { openAsBlob } from "node:fs";
const factify = new Factify({ bearerAuth: process.env.FACTIFY_KEY });
const result = await factify.documents.create({
payload: await openAsBlob("./contract.pdf"),
title: "My First Document",
});
console.log(`Document ID: ${result.createDocumentResponse?.document.id}`);
Generate a Share Link
Create a secure, time-limited URL to share the document:const entry = await factify.entryPages.generate({
documentId: result.createDocumentResponse?.document.id,
});
console.log(`Share URL: ${entry.generateEntryPageResponse?.downloadUrl}`);
Complete Example
Here’s a complete working example:
import { Factify } from "@factify/sdk";
import { openAsBlob } from "node:fs";
async function main() {
// Initialize client
const factify = new Factify({ bearerAuth: process.env.FACTIFY_KEY });
// Upload document
const doc = await factify.documents.create({
payload: await openAsBlob("./contract.pdf"),
title: "Q4 Sales Agreement",
});
const documentId = doc.createDocumentResponse?.document.id;
console.log(`Created document: ${documentId}`);
// Generate share link
const entry = await factify.entryPages.generate({
documentId
});
console.log(`Share URL: ${entry.generateEntryPageResponse?.downloadUrl}`);
// List all documents with auto-pagination
for await (const page of await factify.documents.list({ pageSize: 10 })) {
for (const d of page.listDocumentsResponse?.items ?? []) {
console.log(`- ${d.title} (${d.id})`);
}
}
}
main();