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

@chaindoc_io/embed-sdk

v2.2.0

Published

JavaScript/TypeScript SDK for embedding Chaindoc document signing flow via iframe

Readme

Chaindoc Embed SDK

Official JavaScript/TypeScript SDK for embedding Chaindoc signature flows into web applications

npm version License: MIT

What is Chaindoc Embed SDK?

Chaindoc Embed SDK is a lightweight JavaScript library that allows you to seamlessly integrate document signing functionality into your web application. Instead of redirecting users to a separate signing page, you can embed the entire signing experience directly within your site using a modal dialog or inline container.

Features

  • Zero Backend Integration - SDK manages iframe lifecycle; your backend only creates signing sessions
  • Event-Driven Architecture - Type-safe postMessage API for real-time communication
  • Multiple Display Modes - Modal overlay or inline embedding
  • Framework Agnostic - Works with React, Vue, Angular, vanilla JavaScript, or any web framework
  • TypeScript Support - Full type definitions included
  • Secure by Default - Origin validation and sandboxed iframe
  • Lightweight - Zero runtime dependencies, <10KB gzipped
  • Auto-Responsive - Iframe automatically resizes based on content

Installation

npm install @chaindoc_io/embed-sdk

Or using yarn:

yarn add @chaindoc_io/embed-sdk

CDN Usage

You can also use the SDK directly via CDN:

<script src="https://unpkg.com/@chaindoc_io/embed-sdk"></script>
<script>
  const sdk = new ChaindocEmbed.ChaindocEmbed({
    publicKey: "pk_live_xxx",
    environment: "production",
  });
</script>

Quick Start

import { ChaindocEmbed } from "@chaindoc_io/embed-sdk";

// Initialize SDK
const sdk = new ChaindocEmbed({
  publicKey: "pk_live_xxx",
  environment: "production",
});

// Open signature flow in modal
const instance = sdk.openSignatureFlow({
  sessionId: "ses_xxx", // From your backend
  email: "[email protected]",
  mode: "modal",
  language: "en", // Optional: UI language (en, ru, uk, pl, de, es, pt, fr, et, kk, zh, hi, tr, vi)
  onSuccess: (data) => {
    console.log("Document signed!", data);
    instance.close();
  },
  onError: (error) => {
    console.error("Signing failed:", error);
  },
});

publicKey today

publicKey is still required and validated on SDK initialization, but it is not currently forwarded to the iframe or used for runtime authentication. The real embedded auth flow is:

  1. Your backend creates an embedded session
  2. The signer verifies OTP
  3. The iframe receives a short-lived JWT for /api/v1/embedded/*

The field remains in the API for backward compatibility and future productization, but for Phase 0 it should be understood as ceremonial rather than security-critical runtime auth.

How It Works

  1. Your backend creates a signing session via Chaindoc API
  2. You pass the sessionId to the SDK
  3. SDK opens an iframe with the Chaindoc signing UI
  4. User completes OTP verification and signs the document
  5. SDK receives success event and calls your callback
  6. You can verify the signature on your backend

Display Modes

Modal Mode (Default)

Opens a centered modal dialog with overlay - perfect for most use cases.

Inline Mode

Embeds the signing flow directly into a container element on your page - ideal for multi-step forms or dedicated signing pages.

Browser Support

  • Chrome/Edge 90+
  • Firefox 88+
  • Safari 14+
  • Mobile Safari 14+
  • Chrome Android 90+

Documentation

For detailed documentation, API reference, and examples, visit:

Changelog

See CHANGELOG.md for release history and migration guides.

License

MIT License - see LICENSE file for details

Support

  • GitHub Issues: Report a bug
  • Documentation: https://chaindoc.io/docs

Made with ❤️ by the Chaindoc team