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

@cognior/iap-sdk

v0.2.8

Published

Intelligent Adoption Platform (IAP) JavaScript/TypeScript SDK for creating guided user experiences, tours, tooltips, modals, and surveys across web applications

Readme

Intelligent Adoption Platform (IAP) SDK

A framework-agnostic JavaScript/TypeScript SDK for creating interactive user flows, onboarding experiences, tooltips, modals, surveys, and walkthroughs in web applications.

This README is for end users integrating the SDK from the npm registry.

Overview

The DAP SDK enables developers to create guided user experiences driven by backend-defined Flow JSON configurations. It provides a comprehensive suite of UI components and interaction patterns that help users navigate and learn your application.

Architecture: Backend Flow Engine → DAP SDK → Interactive UI Components

Typical Use Cases

  • User Onboarding: Step-by-step guided tours for new users
  • Feature Discovery: Interactive tooltips and hotspots highlighting new features
  • Contextual Help: Smart assistance based on user location and behavior
  • Surveys & Feedback: In-app surveys and micro-surveys for user insights
  • Task Guidance: Walkthrough workflows and complex processes
  • Knowledge Base: Embedded help content and documentation

Features

Core Capabilities

  • Step-based Flow System: Linear and AnyOrder execution models
  • Mandatory vs Optional Steps: Flexible flow completion requirements
  • Advanced Trigger System: DOM, Input, Lifecycle, and Time-based triggers
  • Rule-based Branching: Dynamic flow paths based on user input
  • Multi-page Support: Seamless flows across SPAs and traditional pages
  • Real-time Analytics: Comprehensive telemetry and user behavior tracking
  • One-time vs Recurring: Configurable flow frequency and targeting

UI Components

  • Modals: Rich content modals with dragging, resizing, and accessibility
  • Tooltips: Contextual help tooltips with smart positioning
  • Popovers: Interactive popovers with custom content
  • Banners: Page-level announcements and notifications
  • Hotspots: Visual indicators for interactive elements
  • Surveys: Inline and modal survey components
  • Walkthroughs: Multi-step guided tours
  • Task Lists: Interactive checklists and progress tracking

Browser & Platform Support

  • Modern Browsers: Chrome 80+, Firefox 75+, Safari 13+, Edge 80+
  • SPA Compatibility: React, Angular, Vue, Svelte, and vanilla JavaScript
  • MPA Support: Traditional multi-page applications
  • Mobile: Responsive design with touch support
  • Accessibility: WCAG 2.1 AA compliant components

Install

npm install @cognior/iap-sdk
# or
yarn add @cognior/iap-sdk

What you need to integrate

1) A configuration endpoint (configUrl) (required)

You must provide a URL that returns the IAP configuration JSON.

Example response:

{
  "organizationid": "your-org-id",
  "siteid": "your-site-id",
  "apikey": "your-api-key",
  "apiurl": "https://api.yourcompany.com",
  "enableDraggableModals": true
}

2) Initialization in your app (required)

Initialize once (typically on app startup) and pass configUrl.


Usage (recommended): ES Modules (Webpack/Vite/Rollup)

import { init, setUser } from "@cognior/iap-sdk";

await init({
  configUrl: "https://api.yourcompany.com/config",
  debug: false
});

// Optional: set user context for targeting and analytics
setUser({
  id: "user_123",
  role: "admin",
  email: "[email protected]",
  attributes: {
    department: "engineering"
  }
});

Usage: CommonJS

const { init, setUser } = require("@cognior/iap-sdk");

init({
  configUrl: "https://api.yourcompany.com/config"
}).then(() => {
  setUser({ id: "user_123" });
});

Usage: Script tag (UMD)

If you can’t use bundlers/modules, you can load the UMD build and access the global variable.

<!doctype html>
<html>
  <head>
    <script src="https://unpkg.com/@cognior/iap-sdk@latest/dist/index.umd.js"></script>
  </head>
  <body>
    <script>
      window.addEventListener("DOMContentLoaded", async () => {
        await window.DAP.init({
          configUrl: "https://api.yourcompany.com/config",
          debug: false
        });

        window.DAP.setUser({
          id: "user_123",
          role: "user"
        });
      });
    </script>
  </body>
</html>

Note: the UMD build exposes a global DAP variable (as shown above). This is part of the runtime API.


API (common integration points)

init(opts) (required)

Initializes the SDK.

init(opts: {
  configUrl: string;
  debug?: boolean;
  screenId?: string;
  user?: {
    id: string;
    role?: string;
    email?: string;
    attributes?: Record<string, string>;
  };
}): Promise<void>;

User context (optional but recommended)

Use user context to enable personalized experiences and better analytics.

import { setUser, updateUser, getUser, clearUser } from "@cognior/iap-sdk";

setUser({ id: "user_123", role: "admin" });

updateUser({
  attributes: { subscription_tier: "pro" }
});

console.log(getUser());

clearUser(); // on logout

Integration guidance

Single Page Apps (React/Angular/Vue/etc.)

  • Initialize once on app startup.
  • Set/clear user context when auth state changes.

Multi Page Apps

  • Initialize on each page load (e.g., DOMContentLoaded).

Selector best practices (for experiences that target elements)

Use stable selectors where possible (e.g., data-* attributes) to avoid breakage when CSS classes change.

<button data-iap="onboarding-next">Next</button>

Build outputs (what you get when installed)

  • dist/index.esm.js — ES Module build
  • dist/index.cjs.js — CommonJS build
  • dist/index.umd.js — UMD build (script tag / global)
  • dist/index.d.ts — TypeScript definitions

License

See LICENSE.