Factify API is currently in Beta.
Learn how to upload a PDF and create a new document in Factify.
import { Factify } from "@factify/sdk"; import { openAsBlob } from "node:fs"; const factify = new Factify({ bearerAuth: process.env.FACTIFY_KEY }); async function uploadDocument() { const result = await factify.documents.create({ payload: await openAsBlob("./contract.pdf"), title: "Q4 Sales Agreement", }); console.log(`Document ID: ${result.createDocumentResponse?.document.id}`); return result.createDocumentResponse?.document; } uploadDocument();
{ "document": { "id": "doc_01h2xcejqtf2nbrexx3vqjhp41", "title": "Q4 Sales Agreement", "created_at": "2024-01-15T10:30:00Z", "current_version": { "id": "ver_01h2xcejqtf2nbrexx3vqjhp42" } } }