node-js
Ignisign Node Example: Integrating the Ignisign NodeJS SDK
This repository offers a practical example of integrating the Ignisign NodeJS SDK into your application. The sample is a straightforward CRM backend, demonstrating main Ignisign functionalities.
Prerequisites
- NodeJS, version 18.0.0 or higher
- NPM or Yarn
Setup and Usage
-
Environment Configuration: Start by creating a
.env
file from.env.example
. Fill in your Ignisign credentials. -
Acquire API Keys:
- Find your
appId
,appEnv
, andappSecret
in the "API Keys" section of the Ignisign Console.
- Find your
-
Setting up a Webhook Endpoint:
- Create a webhook endpoint in your application and register it as a
webhook end-point
in the Ignisign Console (webhooks section). - Consider using ngrok during your development to establish a tunnel to your localhost. (Note: This is a suggestion, not an endorsement.)
- If you are using ngrok, the command to establish a tunnel is
ngrok http http://localhost:4242
. - The process must be keeped live (use a dedicated terminal to execute).
- The process will generate a URL that you can use as the server_root for your webhook endpoint.
- If you are using ngrok, the command to establish a tunnel is
- Your webhook endpoint should follow the format:
{your_server_root_url}/v1/ignisign-webhook
.
- Create a webhook endpoint in your application and register it as a
-
Installation and Launch:
- Install dependencies with
yarn install
(ornpm install
). - Launch the application using
yarn dev
.
- Install dependencies with
Integration with the Ignisign JS Example
- Pair this backend with the Ignisign JS Example (
../ignisign-js
). - Follow instructions in the README.md of the Ignisign JS Example for setup and configuration.
Key Points on Ignisign Interactions
- Core Interactions: The
src/services/ignisign-sdk-manager.service.ts
file handles essential interactions with the Ignisign API. - Main Endpoints:
src/controllers/app.controller.ts
:POST /v1/ignisign-webhook
for receiving Ignisign webhooks.GET /v1/files/:fileHash/private-file-info
for providing information on private files to the IgnisignJS SDK.GET /v1/app-context
offers arequiredInputs
field to determine necessary information for creating a signer.
src/controllers/contract.controller.ts
:POST /v1/contracts
for creating signature requests.
src/controllers/customer.controller.ts
andsrc/controllers/seller.controller.ts
:POST /v1/customers
andPOST /v1/seller
for creating signers.