Integrating eSignatures into Your Node.js Application 

How to Integrate eSignatures into Node.js Application with BoldSign 
How to Integrate eSignatures into Node.js Application with BoldSign 

Table of Contents

Sign Docs 3x Faster

Send, sign, and manage documents securely and efficiently.

Summarize the blog post with:

By integrating eSignatures into your Node.js application, you can easily carry out the entire electronic signature process within your app. This empowers you and your users to perform all eSignature functionalities, including sending signature requests, signing documents, tracking document statuses, and downloading signed documents. Using digital signatures in Node.js, you will streamline the eSignature workflow and eliminate the need for third-party applications, enhancing efficiency and productivity.

In this blog post, we’ll guide you through Node.js eSignature integration using BoldSign, an advanced eSignature solution. With a comprehensive suite of APIs and a robust Node.js SDK, BoldSign makes it easy to integrate electronic signing capabilities into your existing applications.

To demonstrate the benefits of integrating eSignatures, let’s take a real-life situation where you are a software developer working for a real estate agency. Your agency deals with numerous contracts and agreements that require signatures from agents, buyers, sellers, and other parties involved. Managing the signing process manually can be time-consuming, error-prone, and reduce the agency’s efficiency. However, when you integrate eSignatures with Node.js using BoldSign, you can reduce these downsides.

Getting started

To begin integrating eSignatures into your Node.js application using the BoldSign APIs, you’ll need the following prerequisites:

  • Node.js: Ensure that Node.js is installed on your machine.
  • BoldSign account: This can either be a paid account or a free sandbox account. If you don’t have one, you can sign up for a free sandbox account.
  • BoldSign API key: You will need an API key to authenticate your access. You can generate one on the API Key – BoldSign page.

Setting up the Node.js project

If you wish to integrate eSignatures into your existing application, you can skip this step and move to Integrating the BoldSign API section. Otherwise, begin by creating a new directory for your project and initializing a new Node.js project.


npm install express dotenv
    
  • Express: A web application framework for Node.js.
  • Dotenv: A module for loading environment variables from a .env file.

Installing the BoldSign Node SDK

To integrate BoldSign eSignatures into your express application, install the official BoldSign Node.js SDK:


npm install boldsign
    

You can install the BoldSign Node.js SDK using the official Node package available on boldsign – npm

You can also refer to the Official BoldSign Node SDK Documentation, which provides detailed guidance on installation, configuration, and usage in Node.js applications.

These dependencies will enable you to create a server, handle API requests, and load environment variables effectively.

Integrating the BoldSign API

To configure your environment variables, create a .env file in your project directory if you haven’t already done so. Open the file and include your BoldSign API key that you generated previously. This ensures secure communication between your Node.js application and the BoldSign API.


BOLDSIGN_API_KEY=<Your API Key>
    

Integrating the eSignatures into your Node.js application

Now that you have set up the Node.js project, we can integrate the full digital signatures in Node.js using BoldSign APIs.

To expedite the document-creation process for the real estate agency’s contracts, you can utilize a preconfigured template. You have the option to create the templates using either BoldSign for web or the BoldSign API.

Ensure that the templates you create include all the necessary information and fields required to complete your contracts or agreements. By including all the essential details in the templates, you can simplify the document preparation process and facilitate efficient completion of agreements.

Creating-template-for-real-estate-scenario
Creating template for real estate scenario

Implementing document creation

Let’s proceed with implementing the document creation in your Node.js application. We need to create a dedicated route or API endpoint to handle this task. To accomplish this, use the BoldSign Node.js SDK to handle the request from your route and send the document. To initiate the signing process, you can make use of the BoldSign send API.

Here’s an example code snippet of how you can create a document from a template in your Node.js application.


import express from 'express'; 
import { TemplateApi } from 'boldsign';
import 'dotenv/config'; 
	
const app = express(); 
app.use(express.json()); 
	
const templateApi = new TemplateApi(); 
templateApi.setApiKey(process.env.BOLDSIGN_API_KEY); 
	
// Define route for document creation and extract necessary data from request body
app.post('/create-document', async (req, res) => { 
	const { sellerName, sellerEmail, buyerName, buyerEmail, amount, address, templateId } = req.body; 
	
	const data = { 
		roles: [ 
		{ 
			roleIndex: 1, 
			signerName: sellerName, 
			signerEmail: sellerEmail, 
			existingFormFields: [ 
				{ 
					id: '<labelField1>', 
					value: address, 
				}, 
				{ 
					id: '<labelField2>', 
					value: amount,
				}, 
			], 
		}, 
		{ 
			roleIndex: 2, 
			signerName: buyerName, 
			signerEmail: buyerEmail,
			formFields: [ 
				{ 
					fieldType: "Signature", 
					pageNumber: 1, 
					bounds: { x: 100, y: 300, width: 200, height: 50 },
				} 
			], 
		} 
		], 
		disableEmails: true 
	}; 
			
	const response = await templateApi.sendUsingTemplate(templateId, data); 
	const docId = response.documentId; 
	
	res.status(200).json({ success: true, documentId: docId}); // Send a success response with document ID 
});
    

Generating the embedded signing URL

By default, BoldSign sends an email to the signers requesting them to sign and complete the contracts within the BoldSign application. Alternatively, you can use embedded signing by setting disableEmails=true when sending documents. This prevents BoldSign from sending signature request emails and allows signers to complete the signing process within your application.

Signing page embedded in an application
Signing page embedded in an application

To generate an embedded signing URL, you can make use of the BoldSign getEmbeddedSignLink API. Here is an example code snippet to get the embedded sign link in a Node.js application.


import { DocumentApi } from 'boldsign'; 
import 'dotenv/config'; 
const documentApi = new DocumentApi(); 
documentApi.setApiKey(process.env.BOLDSIGN_API_KEY);
 
const docId = 'YOUR_DOCUMENT_ID'; 
const sellerEmail = 'SELLER_EMAIL_ADDRESS'; 
// If a redirect URL is specified, the iFrame will redirect users to it after they sign the document. 
const redirectUrl = '{your-host}/{your-redirect-path}'; 
const result = await documentApi.getEmbeddedSignLink(docId, sellerEmail, null, null, null, redirectUrl); 
// Get the embedded signing URL. 
const signUrl = result.signLink;
    

To seamlessly integrate the signing process into your application, load the sign page URL, within an iFrame in your application. This allows the recipient to interact with the signing page within your application—one of the key benefits of integrating eSignatures with Node.js.

Integrate webhooks to download completed documents

You can integrate webhooks into your Node.js application to automate the process of downloading completed PDF documents and efficiently distribute them to the relevant parties. Subscribe to the DocumentCompleted event, which triggers after all parties sign and the final PDF is generated.

After the signing process is successfully completed, you can use the BoldSign Download API to download the signed document if you wish to save a copy for future use. The following code snippet illustrates this.


import { DocumentApi } from 'boldsign'; 
import 'dotenv/config'; 
import { writeFileSync } from 'fs'; 
const documentApi = new DocumentApi(); 
documentApi.setApiKey(process.env.BOLDSIGN_API_KEY); 
const documentId = 'YOUR_DOCUMENT_ID'; 
// Download the PDF as a Buffer 
const pdfBuffer = await documentApi.downloadDocument(documentId); 
// Write the buffer to a PDF file 
writeFileSync('FILE_NAME.pdf', pdfBuffer);
    

Upon receiving the Download Document API response, you can send emails containing the completed PDF files to the relevant parties. With webhooks in place, you can ensure timely delivery of signed documents to the concerned stakeholders, simplifying your document management process. Refer to the Webhooks documentation for further details and see the Verify Webhook Events guide for security best practices.

Conclusion

By leveraging the power of BoldSign and its Node.js SDK, companies like real estate agencies can integrate eSignatures into their Node.js applications and streamline the contract‑signing process. Irrespective of your industry or scenario, the steps outlined in this blog post enable you to seamlessly integrate BoldSign into your Node.js application, enhancing the eSignature experience of your users.

To learn more about the BoldSign APIs, check out our API documentation. Live API demos are also available for several scenarios. Sample code for popular programming languages is available in this GitHub repo.

Ready to get started? Create a free BoldSign Developer Sandbox account and begin building eSignature workflows in your application today. 

If you have questions, you can contact us through our support portal. We are always happy to assist you!

FAQs

How do I integrate eSignatures into a Node.js application?

You can integrate eSignatures into a Node.js application by configuring your BoldSign API key, setting up your Node.js backend, and using BoldSign APIs or the official Node.js SDK to send documents, collect signatures, and track signing status. For more details, see the official BoldSign Node SDK documentation.


Does BoldSign have a Node.js SDK for eSignatures? 

Yes, the official Node.js SDK is available on npmjs and GitHub. It supports sending, embedded sending and signing, tracking, Sender Identities, and more. For more details, see the official BoldSign Node SDK documentation.


What is a good eSignature API for Node.js integration?

BoldSign is an excellent choice for Node.js integration, offering comprehensive APIs and an official Node.js SDK that supports sending documents, embedding signing experiences, tracking status, downloading signed files, and managing signing workflows directly within your application.


How do I embed electronic signatures in a Node.js app without sending users away from my application?

You can embed signing inside your Node.js app by using BoldSign’s embedded signing flow. BoldSign supports embedded signing through secure signing links that can be opened within your app experience, including options such as an iFrame, popup window, or a new tab.


Can I integrate eSignatures into Node.js for free?

Yes. You can start building and testing a Node.js eSignature integration for free with BoldSign’s sandbox account for API testing and integration.

Like what you see? Share with a friend.

Latest blog posts

Passkey Authentication: How It Works, Benefits, Limits, and Best Uses

Passkey Authentication: How It Works, Benefits, Limits, and Best Uses

Learn what passkey authentication is, how it works, where it beats passwords and OTPs, and when signer verification is still needed for document workflows.

Healthcare eSignature: How Healthcare Providers Collect Patient Consent Digitally 

Healthcare eSignature: How Healthcare Providers Collect Patient Consent Digitally 

Explore healthcare eSignature workflows that help providers collect patient consent digitally across intake, check-in, telehealth, and record management.

Webinar Show Notes: Verify Signers with Knowledge-Based Authentication in BoldSign

Webinar Show Notes: Verify Signers with Knowledge-Based Authentication in BoldSign

KBA authentication webinar recap: how signers verify with security questions, what happens when verification fails, and how KBA compares to ID Verification.

Sign up for your free trial today!

  • Yes
    30-day free trial
  • Yes
    No credit card required
  • Yes
    30-day free trial
  • Yes
    No credit card required
Sign up for a free BoldSign trial