JavaScript PDF Signature Integration: How to Sign PDFs in Node.js
To build a JavaScript PDF signature integration and sign PDFs in Node.js, use the TurboDocx SDK in 3 steps: Install the TurboDocx SDK (npm install @turbodocx/sdk), configure TurboSign.configure() with your API key, org ID, and sender email, then call TurboSign.sendSignature() with the PDF file, recipients, and signature field placement. TurboDocx emails each recipient a signing link and returns a document ID you can poll or track by webhook. The SDK is a typed client for the TurboDocx e-signature API.
This guide shows you how to integrate e-signatures into your Node.js or TypeScript application in under 5 minutes.
Last updated: November 12, 2026
Step 0: Get a free API key (5 signatures a month)
Create a free TurboDocx account, then copy your API key and organization ID from Settings → Developers → API keys. The Free plan includes 5 e-signatures a month, enough to run this guide end to end. Every method is documented in the JavaScript SDK reference.
Same SDK guide in other languages: TypeScript · Python · PHP · Java · Go. Prefer raw HTTP? See the endpoints on the e-signature API page.
5 min
Setup time
TypeScript
Full type support
Async/Await
Modern patterns
How do I install the JavaScript SDK?
Install the TurboDocx SDK from npm. The package includes full TypeScript definitions.
npm install @turbodocx/sdkRequirements: Node.js 18+. The ESM examples use top-level await, so set "type": "module" in package.json or use .mjs files. TypeScript 4.7+ optional for type checking.
Where do I find my API key and org ID?
Before you begin, you'll need your API credentials from the TurboDocx dashboard.
- Sign up for a free account at TurboDocx
- Navigate to Settings → Developers → API keys
- Copy your API Key and Organization ID
TURBODOCX_API_KEY=your_api_key_here
TURBODOCX_ORG_ID=your_org_id_here
TURBODOCX_SENDER_EMAIL=you@company.com
TURBODOCX_SENDER_NAME=Your Company NameHow do I send a PDF for signature with JavaScript?
Use the SDK to send a document for signature. The recipient will receive an email with a link to sign.
import { TurboSign } from '@turbodocx/sdk';
import { readFileSync } from 'fs';
// Configure with your API credentials
TurboSign.configure({
apiKey: process.env.TURBODOCX_API_KEY,
orgId: process.env.TURBODOCX_ORG_ID,
senderEmail: process.env.TURBODOCX_SENDER_EMAIL, // REQUIRED
senderName: process.env.TURBODOCX_SENDER_NAME // Recommended
});
// Read PDF file
const pdfBuffer = readFileSync('contract.pdf');
// Send document for signature
const result = await TurboSign.sendSignature({
file: pdfBuffer,
documentName: 'Partnership Agreement',
recipients: [
{ name: 'John Doe', email: 'john@example.com', signingOrder: 1 }
],
fields: [
{
type: 'signature',
recipientEmail: 'john@example.com',
template: {
anchor: '{signature1}',
placement: 'replace',
size: { width: 100, height: 30 }
}
}
]
});
console.log('Document ID:', result.documentId);Important: The senderEmail is required and will be used as the reply-to address for signature request emails.
How do I know when the PDF is signed?
Configure webhooks to receive real-time notifications when documents are signed. Verify the X-TurboDocx-Signature header with verifyWebhookSignature() before trusting a payload; it needs the raw request body, so mount the route with express.raw() instead of express.json().
import express from 'express';
import { TurboSign, verifyWebhookSignature } from '@turbodocx/sdk';
const app = express();
// Raw body required for signature verification; a JSON body parser would rewrite the bytes
app.post('/webhooks/turbosign', express.raw({ type: 'application/json' }), async (req, res) => {
const valid = verifyWebhookSignature(
req.body,
req.headers['x-turbodocx-signature'],
req.headers['x-turbodocx-timestamp'],
process.env.TURBODOCX_WEBHOOK_SECRET,
);
if (!valid) return res.status(401).json({ error: 'invalid signature' });
const { event, data } = JSON.parse(req.body.toString());
if (event === 'signature.document.completed') {
console.log('Document signed:', data.document_id);
// Download the signed PDF
const signedPdf = await TurboSign.download(data.document_id);
// download() returns a Blob; saveToStorage is your own function
await saveToStorage(Buffer.from(await signedPdf.arrayBuffer()), `signed-${data.document_id}.pdf`);
}
res.status(200).json({ received: true });
});What can I build next?
You now have everything you need to integrate document signing into your JavaScript application using the TurboDocx e-signature API. It handles authentication, document delivery, signature collection, status webhooks, and legally-binding audit trails.
What you can do next:
- Add multiple recipients with sequential signing order
- Use different field types: initials, dates, text, checkboxes
- Poll
TurboSign.getStatus()or nudge outstanding signers withsendReminder() - Get audit trails and compliance certificates
Related Guides
Embed E-Signatures in React
Let signers sign inside your own front end with the @turbodocx/embed component instead of an emailed link.
Sign Documents with TypeScript
The fully typed version: imported SDK types, tsconfig and ESM setup, end-to-end type safety.
Sign Documents with Python
Integrate document signing into Django, FastAPI, or Flask applications.
Sign Documents with PHP
Add document signing to Laravel or Symfony applications with Composer.
Resources
Frequently Asked Questions
How do I sign a PDF with JavaScript?
To sign a PDF with JavaScript, install the TurboDocx SDK (npm install @turbodocx/sdk), configure it with your API key, then use TurboSign.sendSignature() to send the document for e-signature. The recipient receives an email with a signing link.
How do I integrate PDF signature status into a JavaScript app?
Poll TurboSign.getStatus(documentId) for on-demand checks, or verify the X-TurboDocx-Signature header on your webhook endpoint with verifyWebhookSignature() to get a push notification the moment a signature.document.completed event fires.
Is the TurboDocx JavaScript SDK free?
Yes. @turbodocx/sdk is open source under the MIT license, and API access is included on every TurboDocx plan, including the Free plan with 5 e-signatures per month.
Does the JavaScript SDK support TypeScript?
Yes, the TurboDocx JavaScript SDK includes full TypeScript definitions out of the box. No additional @types packages are needed.
Ready to Get Started?
Create a free account and get your API key. Start sending documents for signature in minutes.