Overview
This quickstart walks you through uploading your first document, creating a version, and generating a shareable link.Set Your API Key
Get your API key from the Developer Dashboard and set it as an environment variable:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Factify API is currently in Beta.
Get up and running with Factify in 5 minutes.
Install the SDK
npm install @factify/sdk
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
export FACTIFY_KEY=ffy_live_xxxxxxxxxxxxxxxxxxxx
Upload a Document
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}`);
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();