npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@digifi/digifi-node-js

v6.13.0

Published

DigiFI SDK for Node JS

Readme

DigiFi Node.js Library

Version Build Status Downloads

The DigiFi Node library provides convenient access to the DigiFi API from applications written in server-side JavaScript.

Documentation

See the API docs.

Requirements

Node 12 or higher.

Installation

Install the package with:

npm install @digifi/digifi-node-js --save
# or
yarn add @digifi/digifi-node-js

Usage

This package provides API Clients and API Services to help you communicate with DigiFi platform.

In order to start communication with DigiFi platform API you need to create DigiFi API Service by providing the url to the DigiFi platform (this url can be different if you're using dedicated platform solution) and api-key.

const Digifi = require('@digifi/digifi-node-js');

const digifiApi = new Digifi.DigifiApi('https://cloud.digifi.io/api', 'digifi-...', {
  apiVersion: '2024-02-26',
});

const { items, total } = await digifiApi.applications.find({ productId: '63d...' });

console.log(items);

Usage with TypeScript

DigiFi maintains types for the latest API Version.

import { CreateApplicationParams, Application, DigifiApi } from '@digifi/digifi-node-js';

const digifiApi = new DigifiApi('https://cloud.digifi.io/api', 'digifi-...', {
  apiVersion: '2024-02-26',
});

const createApplication = async () => {
  const params: CreateApplicationParams = {
    productId: '63d288ae64f7677836046de7',
    ...,
  };

  const application: Application = await digifiApi.applications.create(params);

  console.log(application.id);
};

createApplication();

Configuration

To initialize DigiFi API Service you need provide the following data:

  • baseUrl of DigiFi Platform API endpoint as first argument,
  • api-key as second argument and
  • apiVersion in options object as third argument.
import { DigifiApi } from '@digifi/digifi-node-js';

const baseUrl = 'https://cloud.digifi.io/api';
const apiKey = 'digifi-cloud-...';

const digifiApi = new DigifiApi(baseUrl, apiKey, {
  apiVersion: '2024-02-26',
});

Options

API client can be created with required options parameter that has this structure:

| Option | Default | Required | Description | | -------------------------------- |---------|----------|------------------------------------------------------------------------------------------------------------------------------------| | apiVersion | | true | Api version to use for client. | | enableIdempotencyHeader | false | false | If true is provided it allows POST requests to be idempotent | | maxNetworkRetries | 0 | false | The amount of times a request should be retried if error occured | | logger | null | false | Logger for tracing errors and requests |

Idempotency

Idempotency Header can be enabled with the enableIdempotencyHeader to prevent duplication in cause of retry. Librabry will automatically assign idempotency header key (generated by UUID v4) to each POST request.

const digifiApi = new DigifiApi('https://cloud.digifi.io/api', 'digifi-cloud-...', {
  apiVersion: '2024-02-26',
  enableIdempotencyHeader: true, // Will assign idempotency key to each POST request using UUID
});

Network retries

Automatic network retries can be enabled with the maxNetworkRetries config option. This will retry requests n times with exponential backoff if they fail due to an intermittent network problem.

const digifiApi = new DigifiApi('https://cloud.digifi.io/api', 'digifi-cloud-...', {
  apiVersion: '2024-02-26',
  maxNetworkRetries: 2, // Retry a request twice before giving up
});

API Services

An instance of Digifi Api Service class has several properties, each of them represents entity/domain in DigiFi system

For example, if you need to create a borrower in DigiFi Platform you can use the following structure:

const digifiApi = new DigifiApi(...);

const borrowers = await digifiApi.borrowers.create({ ... });

console.log(borrower.id);

Note You can communicate with DigiFi Platform API directly by AuthorizedApiClient, since it provides method makeCall, but it's recommended to use Digifi API Services to make sure that you're using correct request structure.

Here the list of API Services that DigiFi Node JS Library provides:

  • new DigifiApi.borrowerAccounts(...) - api for borrower accounts.
    • findAccountByEmail(email: string) - returns borrower account.
    • createAccount(accountParams: object, refreshTokenExpirationTimeMinutes?: number) - creates and returns borrower account.
    • getCurrentUser(accountAccessToken: string) - returns current borrower account by accountAccessToken.
    • sendUpdatePhoneNumberCode(phone: string, accountAccessToken: string, accountPasswordValidationToken: string) - send code that confirms phone update for borrower account.
    • updatePhoneNumber(code: string, accountAccessToken: string) - confirms phone update for borrower by code and accountAccessToken.
    • sendAddPhoneNumberCode(phone: string, accountAccessToken: string, accountPasswordValidationToken: string) - send code that confirms phone adding for borrower account.
    • addPhoneNumber(code: string, accountAccessToken: string) - confirms add phone to borrower/intermediary (depends on reference passed to the service) by code and accountAccessToken.
    • deletePhoneNumber(phone: string, accountAccessToken: string, accountPasswordValidationToken: string) - deletes phone for borrower by accountAccessToken and accountPasswordValidationToken.
    • sendUpdateEmailCode(email: string, accountAccessToken: string, accountPasswordValidationToken: string) - sends update email code for borrower to account by accountAccessToken and accountPasswordValidationToken.
    • updateEmailAddress(code: string, accountAccessToken: string) - confirms email update for borrower for account by accountAccessToken.
    • createPasswordValidationToken(password: string, accountAccessToken: string) - creates password validation token for borrower account by password and accountAccessToken.
    • updatePassword(oldPassword: string, newPassword: string, accountAccessToken: string) - updates password for borrower account.
    • find(params: object) - finds borrower accounts by params object.
  • new DigifiApi.borrowerEmailVerification(...) - api for borrower accounts email verification.
    • sendVerificationEmail(accountAccessToken: string) - sends verification email for borrower account by accountAccessToken.
    • verifyEmail(code: string, accountAccessToken: string) - verifies email for borrower account using code by accountAccessToken.
  • new DigifiApi.borrowerInvites(apiClient: ApiClient) - api for borrower invitation management.
    • acceptInvite(inviteParams: object, refreshTokenExpirationTimeMinutes?: number) - accepts invite for borrower account.
    • getInviteInfo(token: string) - retrieves invitation information for borrower account by token.
  • new DigifiApi.borrowerPhoneVerification(...) - api for borrower phone verification management.
    • sendMfaCode(phone: string, accountAccessToken: string) - sends mfa code for borrower account phone by accountAccessToken.
    • verifyMfaCode(code: string, accountAccessToken: string) - verifies mfa code for borrower account by accountAccessToken.
  • new DigifiApi.borrowerResetPassword(...) - api for borrower account reset password management.
    • sendResetPasswordLink(email: string) - sends reset password link to borrower account email.
    • resetPassword(password: string, resetPasswordToken: string) - resets password for borrower account by resetPasswordToken.
    • getResetPasswordTokenInfo(resetPasswordToken: string) - retrieves reset password token info for borrower account by resetPasswordToken.
  • new DigifiApi.borrowerSessions(...) - api for borrower account session management.
    • createSession(email: string, password: string, refreshTokenExpirationTimeMinutes?: number) - creates session for borrower account.
    • createSessionWithPhoneVerificationCode(phoneVerificationCode: string, refreshTokenExpirationTimeMinutes?: number) - creates session for borrower account by phoneVerificationCode.
    • sendPhoneVerificationCode(phone: string) - sends phone verification code for borrower account by phone.
    • validateToken(accountAccessToken: string) - validates access token for borrower account.
    • logout(accountAccessToken: string) - kills session associated with borrower account by accountAccessToken.
    • resignAccessToken(accountRefreshToken: string) - resign access token for borrower account by accountRefreshToken.
  • new DigifiApi.intermediaryAccounts(...) - api for intermediary accounts.
    • findAccountByEmail(email: string) - returns intermediary account.
    • createAccount(accountParams: object, refreshTokenExpirationTimeMinutes?: number) - creates and returns intermediary account.
    • getCurrentUser(accountAccessToken: string) - returns current intermediary account by accountAccessToken.
    • sendUpdatePhoneNumberCode(phone: string, accountAccessToken: string, accountPasswordValidationToken: string) - send code that confirms phone update for intermediary account.
    • updatePhoneNumber(code: string, accountAccessToken: string) - confirms phone update for intermediary by code and accountAccessToken.
    • sendAddPhoneNumberCode(phone: string, accountAccessToken: string, accountPasswordValidationToken: string) - send code that confirms phone adding for intermediary account.
    • addPhoneNumber(code: string, accountAccessToken: string) - confirms add phone to intermediary by code and accountAccessToken.
    • deletePhoneNumber(phone: string, accountAccessToken: string, accountPasswordValidationToken: string) - deletes phone for intermediary by accountAccessToken and accountPasswordValidationToken.
    • sendUpdateEmailCode(email: string, accountAccessToken: string, accountPasswordValidationToken: string) - sends update email code for intermediary to account by accountAccessToken and accountPasswordValidationToken.
    • updateEmailAddress(code: string, accountAccessToken: string) - confirms email update for intermediaryfor account by accountAccessToken.
    • createPasswordValidationToken(password: string, accountAccessToken: string) - creates password validation token for intermediary account by password and accountAccessToken.
    • updatePassword(oldPassword: string, newPassword: string, accountAccessToken: string) - updates password forintermediary account.
    • find(params: object) - finds intermediary accounts by params object.
  • new DigifiApi.intermediaryEmailVerification(...) - api for intermediary accounts email verification.
    • sendVerificationEmail(accountAccessToken: string) - sends verification email for intermediary account by accountAccessToken.
    • verifyEmail(code: string, accountAccessToken: string) - verifies email for intermediary account using code by accountAccessToken.
  • new DigifiApi.intermediaryInvites(...) - api for intermediary invitation management.
    • acceptInvite(inviteParams: object, refreshTokenExpirationTimeMinutes?: number) - accepts invite for intermediary account.
    • getInviteInfo(token: string) - retrieves invitation information for intermediary account by token.
  • new DigifiApi.intermediaryPhoneVerification(...) - api for borrower/intermediary phone verification management.
    • sendMfaCode(phone: string, accountAccessToken: string) - sends mfa code for intermediary account phone by accountAccessToken.
    • verifyMfaCode(code: string, accountAccessToken: string) - verifies mfa code for intermediary account by accountAccessToken.
  • new DigifiApi.intermediaryResetPassword(...) - api for borrower/intermediary account reset password management.
    • sendResetPasswordLink(email: string) - sends reset password link to intermediary (depends on reference passed to the service) account email.
    • resetPassword(password: string, resetPasswordToken: string) - resets password for intermediary account by resetPasswordToken.
    • getResetPasswordTokenInfo(resetPasswordToken: string) - retrieves reset password token info for intermediary account by resetPasswordToken.
  • new DigifiApi.intermediarySessions(...) - api for intermediary account session management.
    • createSession(email: string, password: string, refreshTokenExpirationTimeMinutes?: number) - creates session for intermediary account.
    • createSessionWithPhoneVerificationCode(phoneVerificationCode: string, refreshTokenExpirationTimeMinutes?: number) - creates session for intermediary account by phoneVerificationCode.
    • sendPhoneVerificationCode(phone: string) - sends phone verification code for intermediary account by phone.
    • validateToken(accountAccessToken: string) - validates access token for intermediary account.
    • logout(accountAccessToken: string) - kills session associated with intermediary account by accountAccessToken.
    • resignAccessToken(accountRefreshToken: string) - resign access token for intermediary account by accountRefreshToken.
  • new DigifiApi.users(...) - api for users management.
  • new DigifiApi.variables(...) - api for variables management.
  • new DigifiApi.decisions(...) - api for decisions management.
  • new DigifiApi.borrowerStandardPortalGeneralSettings(...) - api for borrower standard portal settings management.
    • getGeneralSettings() - retrieves general settings of standard borrower portal for current organization.
  • new DigifiApi.borrowerStandardPortalLegalConsents(apiClient) - api for borrower standard portal legal consents management.
    • getLegalConsents() - retrieves borrower standard portal legal consents for current organization.
  • new DigifiApi.branding(...) - api for organization branding management.
  • new DigifiApi.decisionProcessing(...) - api for processing decisions.
  • new DigifiApi.integrationFileDownload(...) - api for integration files downloads management.
  • new DigifiApi.integrationProcessing(...) - api for processing integrations.
  • new DigifiApi.integrationResultFiles(...) - api for integration result files management.
  • new DigifiApi.integrationResults(...) - api for integration results management.
  • new DigifiApi.applicationDecisionProcessing(...) - api for processing application decisions.
  • new DigifiApi.applicationDocuments(...) - api for application documents management.
  • new DigifiApi.applicationDocumentsDownloads(...) - api for application documents download.
  • new DigifiApi.applicationDocumentsPreview(...) - api for document preview management.
  • new DigifiApi.applicationIntegrationProcessing(...) - api for processing application integrations.
  • new DigifiApi.applicationNotes(...) - api for application notes management.
  • new DigifiApi.applications(...) - api for applications management.
  • new DigifiApi.applicationStatuses(...) - api for application statuses management.
    • find(productId: string) - finds application statuses for current organization and mode (depends on api-key provided to api client) by productId.
  • new DigifiApi.borrowers(...) - api for borrowers management.
  • new DigifiApi.comments(...) - api for comments management.
  • new DigifiApi.intermediaries(...) - api for intermediaries management.
  • new DigifiApi.productCalculations(...) - api for product calculations management.
    • find(productId: string) - finds product calculations for current organization and mode (depends on api-key provided to api client) by productId.
  • new DigifiApi.products(...) - api for products management.
    • find(params: object) - finds products for current organization and mode (depends on api-key provided to api client) by params.
    • findById(id: string) - finds product for current organization and mode (depends on api-key provided to api client) by id.
  • new DigifiApi.tasks(...) - api for application tasks management.
  • new DigifiApi.webhookEndpoints(...) - api for webhooks management.
    • find(params: object) - finds webhook endpoints by params object.
    • findById(id: string) - finds webhook endpoints by id.
    • create(params: object) - creates webhook endpoint by params object.
    • update(id: string, params: object) - updates webhook endpoints by id and params object.
    • delete(id: string) - deletes webhook endpoint by id.
  • new DigifiApi.communications(...) - api for communications management.

Webhook signing

DigiFi can verify webhook events signature it sends to your endpoint, allowing you to validate that they were not sent by a third-party. You can read more about it here.

Please note that you must pass the raw request body, exactly as received from DigiFi, to the verifyWebhookSignature() function; this will not work with a parsed (i.e., JSON) request body.

Here is an example how to use it with express:

const express = require('express');
const digifi = require('digifi-node-js');
const bodyParser = require('body-parser');

const app = express();
const endpointSecret = '...';

app.post('/webhooks', bodyParser.raw({ type: 'application/json' }), (req, res) => {
  const timestamp = req.headers['x-digifi-event-timestamp'];
  const signature = req.headers['x-digifi-signature'];
  
  if (!digifi.verifyWebhookSignature(req.body, endpointSecret, timestamp, signature)) {
    res.status(400).send({ message: 'Invalid signature' });
    
    return;
  }
  
  if (!digifi.verifyWebhookTimestamp(timestamp)) {
    res.status(400).send({ message: 'Invalid timestamp' });
    
    return;
  }

  switch (req.body.eventType) {
    case 'application.created': {
      handleApplicationCreate();
    }
    case 'application.updated': {
      handleApplicationUpdate();
    }
  }

  res.status(200).send({});
});

app.listen(3000, () => {
  console.log(`Example app listening at http://localhost:3000`)
});

Support

New features and bug fixes are released on the latest major version of the @digifi/digifi-node-js package. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.

More Information