---
title: "3 Steps: JavaScript PDF Signature Integration | TurboDocx"
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"
---

# How to Build a JavaScript PDF Signature Integration

> 3 steps to a JavaScript PDF signature integration: 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.

Developer Guide by David González (Contributing Writer). Published January 29, 2025. Last updated October 16, 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), [GitHub SDK](https://github.com/TurboDocx/SDK/tree/main/packages/js-sdk), [Full API Reference](https://docs.turbodocx.com/docs/SDKs/javascript).

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

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

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

**Requirements:** Node.js 18+ or modern browser. TypeScript 4.7+ optional for type checking.

## 2. Obtaining an API Key

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

1. [Sign up for a free account](https://app.turbodocx.com) 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. Sending a Signing Request

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.

## Next: Processing Results with Webhooks

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);

    // Save to your storage
    await saveToStorage(signedPdf, `signed-${data.document_id}.pdf`);
  }

  res.status(200).json({ received: true });
});
```

## Conclusion

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) | [Learn more about the e-signature API](https://www.turbodocx.com/e-signature-api.md)
