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

rebill

v1.17.16

Published

Stencil Component Starter

Readme

Rebill Web Components SDK (v3.1)

A framework‑agnostic Web Components SDK (built with Stencil) to embed Rebill checkout, payments, and renewal flows in any website or app.

This SDK provides production‑ready components (checkout form, payment method selector, card iframe, OTP, discounts, summary, renewal), dynamic runtime configuration, i18n support, and a lightweight loader for easy integration.

🚀 Quick Start

Prerequisites

  • Node.js: >= 16.0.0
  • pnpm: >= 8.0.0 (required)

Install pnpm globally if you haven't already:

npm install -g pnpm

1. Install the SDK

pnpm install rebill

2. Use Components (No initialization required!)

<!-- Your HTML - works out of the box with production settings -->
<rebill-checkout></rebill-checkout>

📘 TypeScript / JSX Support

TypeScript support is now automatic! 🎉

If you were experiencing this error:

Property 'rebill-checkout' does not exist on type 'JSX.IntrinsicElements'.

Just update to the latest version and import from the SDK:

import { initializeRebillSDK } from 'rebill/config';
// or
import { defineCustomElements } from 'rebill/loader';

The JSX types will load automatically. No tsconfig.json configuration needed!

// Or programmatically
import { defineCustomElements } from 'rebill/loader';
defineCustomElements(window);

3. Optional: Configure for Different Environments

import { initializeRebillSDK } from 'rebill';

// Only needed if you want to use staging or development
initializeRebillSDK({
  environment: 'staging', // 'development' | 'staging' | 'production'
  debug: true,
});

🔧 Configuration

The SDK works out of the box with production settings. Configuration is optional and only needed for staging or development environments.

Default Behavior

  • Production environment by default
  • No initialization required for client applications
  • Production API endpoints automatically used

Optional Environment Configuration

import { initializeRebillSDK } from 'rebill';

// For staging with CDN assets (optional)
initializeRebillSDK({
  environment: 'staging',
  debug: true,
});

// For staging with local assets
initializeRebillSDK({
  environment: 'staging',
  debug: true,
  assetsUrl: '/sdk/', // Serve assets from local path
});

// For development (optional)
initializeRebillSDK({
  environment: 'development',
  debug: true,
});

// For production (optional - this is the default)
initializeRebillSDK({
  environment: 'production',
  debug: false,
});

Quick Helpers

import { RebillSDK } from 'rebill';

// Quick setup (all optional)
RebillSDK.forProduction(); // Default behavior
RebillSDK.forStaging(); // For testing
RebillSDK.forDevelopment(); // For local development

🚀 Assets Configuration (CDN vs Local)

By default, assets are loaded automatically from CDN. No configuration needed.

The SDK automatically uses https://unpkg.com/rebill@[version]/assets/ to load icons and animations.

Basic Usage (CDN - No Configuration)

import { initializeRebillSDK } from 'rebill';
import { defineCustomElements } from 'rebill/loader';

// Assets load automatically from CDN
initializeRebillSDK({
  environment: 'staging',
  debug: true,
});

defineCustomElements(window);

Using Local Assets

Option 1: Configure via initializeRebillSDK (Recommended)

import { initializeRebillSDK } from 'rebill';
import { defineCustomElements } from 'rebill/loader';

// Configure local assets
initializeRebillSDK({
  environment: 'staging',
  debug: true,
  assetsUrl: '/sdk/', // Use local assets from /sdk/ path
});

defineCustomElements(window);

Important: When using assetsUrl, you must ensure the assets are available at that path. Copy the assets folder from node_modules/rebill/dist/assets/ to your public folder.

Option 2: Using setAssetsURL (Alternative)

import { defineCustomElements } from 'rebill/loader';
import { setAssetsURL } from 'rebill';

// Configure assets before defining elements
setAssetsURL('/sdk/');
defineCustomElements(window);

Complete Example - React with Local Assets

import { useEffect } from 'react';
import { initializeRebillSDK } from 'rebill';
import { defineCustomElements } from 'rebill/loader';

export function useRebillSDK() {
  useEffect(() => {
    const environment = process.env.NEXT_PUBLIC_NODE_ENV as
      | 'development'
      | 'staging'
      | 'production';

    if (environment === 'development' || environment === 'staging') {
      // Use local assets in development/staging
      initializeRebillSDK({
        environment: 'staging',
        debug: true,
        assetsUrl: '/sdk/', // Serve from /public/sdk/ folder
      });
    } else {
      // Use CDN in production
      initializeRebillSDK({
        environment: 'production',
        debug: false,
      });
    }

    defineCustomElements(window);
  }, []);
}

CDN Benefits

  • Zero configuration - Works immediately
  • Global cache - Faster asset loading
  • Automatic versioning - Always uses the correct version
  • No manual copies - No need to copy files
  • Flexible - Can override URL when needed

Local Assets Benefits

  • Full control - Assets served from your domain
  • Offline support - Works without external CDN
  • Custom builds - Can modify assets if needed
  • Privacy - No external requests