Loading...
Welcome to the Templify Node.js SDK! Integrate document generation directly into your Node.js or TypeScript application.
Install the official SDK package via npm, yarn, or pnpm.
npm install templify-sdkInitialize the client with your access token.
import { TemplifySDK } from 'templify-sdk';
const sdk = new TemplifySDK({ accessToken: 'YOUR_ACCESS_TOKEN' });Once initialized, you can fetch templates, generate documents, or render email HTML output.
// Fetch template
const template = await sdk.getTemplate('templateId');
// Generate document
const doc = await sdk.generateDocument('templateId', { ...fields });
// For email templates
const html = await sdk.getEmailHTML('templateId', { ...fields });getTemplate(templateId: string) - Retrieves the structure of a template.generateDocument(templateId: string, fields: Record<string, any>) - Generates a final PDF/Image buffer based on template.getEmailHTML(templateId: string, fields: Record<string, any>) - Returns compiled HTML string for Email templates.