---
title: "JavaScript PDF Signature Integration in Node.js"
description: "3 steps to a JavaScript PDF signature integration: npm install @turbodocx/sdk, add your API key, call TurboSign.sendSignature(). Node.js and webhooks."
url: "https://www.turbodocx.com/guides/sign-documents-with-javascript"
---

# 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](https://www.turbodocx.com/e-signature-api.md).

Developer Guide by David González (Contributing Writer). Published January 29, 2025. Last updated November 12, 2026.

This guide shows you how to integrate e-signatures into your Node.js or TypeScript application in under 5 minutes.

Links: [Get API Key Free](https://app.turbodocx.com/signup?utm_source=website&utm_medium=guides&utm_campaign=sign-documents-with-javascript), [GitHub SDK](https://github.com/TurboDocx/SDK/tree/main/packages/js-sdk), [Full API Reference](https://docs.turbodocx.com/docs/SDKs/javascript).

## Step 0: Get a free API key (5 signatures a month)

[Create a free TurboDocx account](https://app.turbodocx.com/signup?utm_source=website&utm_medium=guides&utm_campaign=sign-documents-with-javascript), 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](https://docs.turbodocx.com/docs/SDKs/javascript).

Same SDK guide in other languages: [TypeScript](https://www.turbodocx.com/guides/sign-documents-with-typescript.md), [Python](https://www.turbodocx.com/guides/sign-documents-with-python.md), [PHP](https://www.turbodocx.com/guides/sign-documents-with-php.md), [Java](https://www.turbodocx.com/guides/sign-documents-with-java.md), [Go](https://www.turbodocx.com/guides/sign-documents-with-go.md). Prefer raw HTTP? See the endpoints on the [e-signature API](https://www.turbodocx.com/e-signature-api.md) page.

Quick install: the [Agentic Quickstart Skill](https://www.turbodocx.com/quickstart.md) wires TurboDocx into your project from your AI coding agent (`npx skills add TurboDocx/quickstart`).

- **5 min** setup time
- **TypeScript**: full type support
- **Async/Await**: modern patterns

## 1. How do I install the JavaScript SDK?

Install the TurboDocx SDK from npm. The package includes full TypeScript definitions.

```bash
npm install @turbodocx/sdk
```

**Requirements:** 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.

## 2. Where do I find my API key and org ID?

Before you begin, you'll need your API credentials from the TurboDocx dashboard.

1. [Sign up for a free account](https://app.turbodocx.com/signup?utm_source=website&utm_medium=guides&utm_campaign=sign-documents-with-javascript) at TurboDocx
2. Navigate to Settings, API Keys
3. Copy your API Key and Organization ID

```bash
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 Name
```

## 3. How 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.

```javascript
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()`.

```javascript
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](https://www.turbodocx.com/e-signature-api.md). 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 with `sendReminder()`
- Get audit trails and compliance certificates

## Related Guides

- [Embed E-Signatures in React](https://www.turbodocx.com/guides/embed-esignature-in-react.md): Let signers sign inside your own front end with the @turbodocx/embed component instead of an emailed link.
- [Sign Documents with TypeScript](https://www.turbodocx.com/guides/sign-documents-with-typescript.md): The fully typed version: imported SDK types, tsconfig and ESM setup, end-to-end type safety.
- [Sign Documents with Python](https://www.turbodocx.com/guides/sign-documents-with-python.md): Integrate document signing into Django, FastAPI, or Flask applications.
- [Sign Documents with PHP](https://www.turbodocx.com/guides/sign-documents-with-php.md): Add document signing to Laravel or Symfony applications with Composer.

## Resources

- [Full API Reference](https://docs.turbodocx.com/docs/SDKs/javascript): Complete SDK documentation with all methods and types.
- [GitHub Repository](https://github.com/TurboDocx/SDK/tree/main/packages/js-sdk): View source code, examples, and contribute.
- [Webhook Setup](https://docs.turbodocx.com/docs/TurboSign/Webhooks): Configure real-time notifications for your app.
- [Developer Hub](https://www.turbodocx.com/developers.md): All TurboDocx SDKs, API docs, and quickstarts.

## 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.

[Get API Key Free](https://app.turbodocx.com/signup?utm_source=website&utm_medium=guides&utm_campaign=sign-documents-with-javascript) | [Learn more about the e-signature API](https://www.turbodocx.com/e-signature-api.md)
