Documentation
Welcome to the Templify developer hub. Learn how to integrate document generation into your app and automate your workflows.
Introduction
Templify is a powerful engine for turning data into documents. Whether you need to generate PDFs, contracts, invoices, or certificates, Templify handles the heavy lifting of layout, rendering, and asset management.
For Developers
Robust API and SDKs to integrate document generation into your software in minutes.
For Designers
Visual template builder to design perfect documents without writing a single line of code.
Quick Start
Get up and running with Templify in less than 5 minutes.
- Create an account: Sign up for a free account at templify.com.
- Get your API Key: Go to your dashboard settings to generate a new API key.
- Install the SDK: Add the Templify SDK to your project.
Installation
Initialization
Import the SDK and initialize it with your API key.
import { Templify } from '@templify/sdk';
const templify = new Templify({
apiKey: 'YOUR_API_KEY',
});Generate Document
The core of Templify is the generate method. It takes a template ID and a data object, and returns a URL to the generated document.
// Generate a document
const response = await templify.generate({
templateId: 'tpl_123456789',
data: {
name: 'John Doe',
company: 'Acme Corp',
date: '2023-10-27'
}
});
console.log(response.documentUrl);
// output: https://templify.com/docs/doc_987654321.pdfYou can also use the raw REST API if you prefer:
curl -X POST https://api.templify.com/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "tpl_123456789",
"data": {
"name": "John Doe"
}
}'Tutorial: Creating a Template
Before you can generate documents, you need a template.
1. Upload or Design
Go to the Template Builder in your dashboard. You can upload an existing PDF/Image to use as a background, or start from a blank canvas.
2. Add Fields
Drag and drop fields onto your template. Examples include:
- Text: For names, addresses, etc.
- Image: For logos or profile pictures.
- Signature: For e-signatures.
- Date: Auto-formatted dates.
3. Name your Fields
Click on each field to access its properties. Give each field a unique Field ID (e.g., customer_name). This ID corresponds to the key in your JSON data object.