Skip to content

About

Identisure API client for TypeScript/JavaScript

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Identisure JavaScript/TypeScript Client

npm Downloads Documentation MIT license

API client for the Identisure REST API. Ships ESM and CJS bundles with full type declarations.

Documentation: identisure.github.io/api-client-js

Requirements

Node 20 or later.

Supported providers

  • BankID SE: auth, sign, phone auth and sign, QR verify, age verification
  • BankID NO: auth, backchannel auth, sign, age verification
  • Freja eID: auth, backchannel auth, sign, backchannel sign, age verification
  • MitID: auth, backchannel auth, sign, age verification
  • FTN (Finnish Trust Network): auth, age verification
  • Vipps MobilePay: auth, backchannel auth
  • Documents: upload and download documents for signing

Installation

npm install @identisure/client

Usage

import { IdentisureClientBuilder } from "@identisure/client";

const client = new IdentisureClientBuilder("client_id", "client_secret")
  .environment("staging")
  .build();

const session = await client.bankidSe().auth({});

const result = await client.bankidSe().waitForAuth(session.id);

console.log(result);

Verifying callbacks

Pass the raw request body exactly as received, before parsing it.

import { verifyCallbackSignature } from "@identisure/client";

const valid = await verifyCallbackSignature(rawBody, req.headers["x-signature-sha256"], hmacSecret);

Development

Prerequisites

Clone

The test fixtures live in a git submodule:

$ git clone --recurse-submodules https://github.com/identisure/api-client-js.git

In an existing clone, run git submodule update --init.

Build

To build the project, simply issue the following command:

$ npm run build

Test

Linting
$ npm run check
$ npm run lint
Unit Testing
$ npm run test

Release

Set the version in package.json and commit. Then push a tag:

$ git tag v0.1.0
$ git push origin v0.1.0

The release workflow checks that the tag matches the version, runs CI, publishes to npm and creates a GitHub release.

Other languages

C#, Dart, Go, Java/Kotlin, PHP, Python, Ruby, Rust, Swift

About

Identisure API client for TypeScript/JavaScript

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages