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

@dsr4ai/miva-bdn-sdk

v0.0.6

Published

MivaBDN SDK provides an easy way to embed the **Miva BDN iframe** in a web application.

Readme

MivaBDN SDK

MivaBDN SDK provides an easy way to embed the Miva BDN iframe in a web application.

Installation

npm install @dsr4ai/miva-bdn-sdk

Getting Started

Using with ES Modules

To get started with ES Modules, simply import the module and use it in your code:

import MivaBDN from '@dsr4ai/miva-bdn-sdk';

Using with UMD Modules

Alternatively, if you're using UMD modules, include the script in your HTML file:

<script src="https://unpkg.com/@dsr4ai/miva-bdn-sdk/dist/index.umd.js"></script>

After importing, you can initialize and use the SDK as follows:

const mivaBDN = new MivaBDN({
  appId: 'your-app-id', // your Miva BDN app ID
  target: '#app',       // container selector
  debug: true,          // optional debug mode
  locale: 'ja',         // optional locale
});

// Initializes the iframe and starts message listening
mivaBDN.init();

// Removes the iframe and event listeners when no longer needed
// mivaBDN.destroy();

Manual Integration

For manual integration, refer to the implementation in src/manual.js.

Usage

Loading a Single Book

You can load a single book in the Miva BDN iframe by specifying the path and sourceId when initializing the MivaBDN instance.

const mivaBDN = new MivaBDN({
  appId: 'your-app-id',    // your Miva BDN app ID
  target: '#app',          // container selector
  debug: true,             // optional debug mode
  locale: 'ja',            // optional locale
  path: '/library',        // Path inside the iframe to load the book
  sourceId: 'source-id', // ID of the book to load
});

// Initializes the iframe and starts message listening
mivaBDN.init();

API

new MivaBDN(options: MivaBDNOptions)

Creates a new MivaBDN instance that manages the iframe.

Options

Property | Type | Description --- | --- | --- appId | string | Unique application identifier. baseUrl | string | Base URL of the Miva BDN loaded in the iframe. debug | boolean | Enables verbose logging. onConfirmed | (data: unknown, instance: MivaBDN) => void | Called when the iframe signals a confirmed event. onReady | (data: unknown, instance: MivaBDN) => void | Called when the iframe signals a ready event. path | string | The relative path to be appended to baseUrl when constructing the iframe URL. Should not include protocol or hostname. locale | string | Locale passed to the Miva application. sourceId | string \| string[] | The identifier(s) provided to the Miva application as content source metadata. Can be a single ID string or an array for multiple sources. sourceScope | SourceScope | Controls which source scopes are loaded by the Miva application. Options: public, private, all. target | HTMLElement \| string | DOM element or CSS selector where the iframe is mounted.

Methods

  • init(): void
    Initializes the iframe and starts message listening.

  • destroy(): void
    Removes the iframe and event listeners when no longer needed.

Error Handling

All critical errors, such as missing required options or invalid targets, are thrown as instances of MivaBDNError.

Security

The SDK verifies the origin of all incoming messages to ensure only messages from the trusted iframe are processed. Messages from untrusted sources are ignored.

License

MIT