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

inklok-sdk-node

v2.1.18

Published

Official Node.js SDK for the Inklok API.

Readme

inklok-sdk-node

Official Node.js SDK for the Inklok API.

The SDK is a thin, typed client over the Inklok public API. It handles base URL normalization, bearer authentication, generated TypeScript types, pagination normalization, signer-session helpers, and encrypted document helpers.

For endpoint schemas, request and response contracts, status codes, and HTTP-level behavior, use the Inklok API reference:

https://docs.inklok.com/docs/api-reference

Installation

npm install inklok-sdk-node

Node.js 18 or newer is required.

Quickstart

import { InklokClient } from "inklok-sdk-node";

const client = new InklokClient({
  baseUrl: "https://api.inklok.com",
  accessToken: process.env.INKLOK_ACCESS_TOKEN!,
});

const orgId = process.env.INKLOK_ORG_ID!;

const myOrgs = await client.listMeOrgs({});

const documents = await client.listDocumentsV1({
  orgId,
});

console.log({ myOrgs, documents });

Authentication

Pass a bearer credential with accessToken.

Supported credentials include:

  • user access tokens for user-driven API calls
  • Inklok API keys for integration calls

For user-token calls, org-scoped methods also require orgId, which the SDK sends as X-Inklok-Org-Id. For API-key calls, org tenancy is derived from the key and the SDK omits the org header.

Use sandbox API keys while developing and testing integrations. Sandbox keys can access sandbox resources without contacting real recipients.

API Base URL

The production Inklok API endpoint is:

https://api.inklok.com

SDK clients and integrations should use this as the production baseUrl.

API Contract Types

The SDK generates TypeScript API contract types from the published OpenAPI specification package:

@inklok/api-spec

Do not hand-edit generated types. Update the API spec package dependency and regenerate SDK types when the API contract changes.

Common Usage

Organization Bootstrap

Use listMeOrgs or getBootstrap after login to discover the current user's organization memberships and bootstrap application state.

const bootstrap = await client.getBootstrap({});

Documents

Use the low-level document methods when you already have encrypted bytes. Use client.documents.upload when you want the SDK to perform client-side encryption before upload.

const uploaded = await client.documents.upload({
  orgId,
  fileBuffer,
  metadata: { filename: "agreement.pdf" },
});

Templates And Agreements

Create a template from a document, publish it, then create agreements from the published template. Use an idempotencyKey when creating durable agreement state that may be retried.

const template = await client.createTemplateV1({
  orgId,
  documentId,
  body: { name: "Standard agreement" },
});

const published = await client.publishTemplateV1({
  orgId,
  workflowId: template.id,
});

const agreement = await client.createAgreementV1({
  orgId,
  workflowId: published.id,
  idempotencyKey: "agreement-request-123",
  body: {
    participants: [{ roleId: "signer", email: "[email protected]" }],
  },
});

For retry rules, see Retry And Idempotency.

Signer Sessions

For magic-link signing, exchange a link code for an in-memory signer session and bind it to signer-facing helpers.

import { SignerSessionManager } from "inklok-sdk-node";

const session = new SignerSessionManager(
  "https://api.inklok.com",
  magicLinkCode,
);

const signer = client.withSignerSession(session);
const signingAgreement = await signer.signing.getSigningAgreement();

Examples

Runnable examples live in examples:

Build the package first, then run an example with environment variables:

npm install
npm run build
INKLOK_API_BASE="https://api.inklok.com" \
INKLOK_ACCESS_TOKEN="token-or-api-key" \
INKLOK_ORG_ID="org-id" \
node examples/basic-client.mjs

Development

npm install
npm run build
npm test

Types are regenerated from @inklok/api-spec before build. Run npm run codegen to regenerate only src/types.d.ts.

Documentation