Skip to main content

Example Project

This example project takes you step-by-step through creating a NodeJS module with the SDK that will automatically send documents from your account with an example template. You can use any IDE (e.g. VS Code) or text editor to make your changes. We assume you have a recent installation of NodeJS.

Installation

In the root of your coding directory use the following to install and start the vite project builder;

  mkdir lesdk-example

cd lesdk-example
npm init -y

Configuring the Typescript compiler

npm install --save-dev typescript

Change directory and install the SDK with the command

npm install legalesign-sdk-js

Open and edit the tsconfig.json file.

{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist"
},
"lib": ["es2015"]
}

Create and edit the send.ts file.

Build and Run

npx tsc
node send.js