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

@mba-web-stories/sdk

v0.1.2

Published

Internal SDK for MBA web stories

Readme

@mba-web-stories/sdk

React SDK for embedding interactive web stories with video content.

Installation

npm install @mba-web-stories/sdk

Usage Options

Option 1: Standard Usage (Recommended)

For most modern build systems (Next.js, Vite, Create React App with proper configuration):

import { WebStories } from '@mba-web-stories/sdk'
// CSS will be handled by your build system
import '@mba-web-stories/sdk/styles'

function App() {
  return (
    <div style={{ width: '100%', height: '400px' }}>
      <WebStories
        galleryId="your-gallery-id"
        apiKey="your-api-key"
        config={{
          apiUrl: 'https://your-api.com/graphql',
          autoplay: false,
          showProgress: true,
          allowKeyboard: true
        }}
      />
    </div>
  )
}

Option 2: Self-Contained (Maximum Compatibility)

For environments where CSS imports might not work:

// This version has CSS inlined in JavaScript
import { WebStories } from '@mba-web-stories/sdk/inline'

function App() {
  return (
    <div style={{ width: '100%', height: '400px' }}>
      <WebStories
        galleryId="your-gallery-id"
        apiKey="your-api-key"
        config={{
          apiUrl: 'https://your-api.com/graphql'
        }}
      />
    </div>
  )
}

Option 3: Manual CSS Import

For custom setups or when you need full control:

import { WebStories } from '@mba-web-stories/sdk'
// Manually import CSS in your HTML or build process
// <link rel="stylesheet" href="node_modules/@mba-web-stories/sdk/dist/index.css">

function App() {
  return (
    <WebStories
      galleryId="your-gallery-id"
      apiKey="your-api-key"
    />
  )
}

Build System Configuration

Next.js

Add to your next.config.js:

const nextConfig = {
  transpilePackages: ['@mba-web-stories/sdk']
}

Vite

Usually works out of the box. If CSS imports fail, use the /inline version.

Webpack

Ensure CSS loading is configured:

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/,
        use: ['style-loader', 'css-loader']
      }
    ]
  }
}

API Reference

WebStories Props

  • galleryId (string, required): The ID of the gallery to display
  • apiKey (string, required): Your API key for authentication
  • config (object, optional): Configuration options
  • className (string, optional): Additional CSS class names

Config Options

  • apiUrl (string): GraphQL API endpoint
  • autoplay (boolean): Auto-play videos when opened
  • showProgress (boolean): Show progress bars
  • allowKeyboard (boolean): Enable keyboard navigation
  • muted (boolean): Start videos muted
  • customStyles (object): Custom CSS styles
  • onStoryChange (function): Callback when story changes
  • onStoryComplete (function): Callback when story completes
  • onGalleryComplete (function): Callback when gallery ends

Defensive Styling

This SDK uses aggressive defensive CSS to ensure it works in any environment:

  • Scoped styles - Won't interfere with your app's CSS
  • CSS reset - Immune to external CSS interference
  • High specificity - Styles always apply correctly
  • Runtime injection - CSS loads even if build system fails
  • Multiple build targets - Works with any bundler

Troubleshooting

Styles Not Loading

  1. Try the /inline import version
  2. Check that your build system processes CSS imports
  3. Manually import the CSS file
  4. The SDK will inject fallback styles automatically

Build Errors

  • Ensure your bundler supports CSS imports
  • Add the package to transpilePackages in Next.js
  • Use the /inline version for problematic environments

TypeScript Issues

Types are included automatically. If you have issues:

import type { WebStoriesProps } from '@mba-web-stories/sdk'