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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rulebricks/embedded

v1.0.0

Published

Embed Rulebricks decision tables in your application

Downloads

865

Readme

Rulebricks Embedded

Embedded Banner

Embed the Rulebricks decision table UI directly in your application, and get access to enterprise-grade business rule configuration, management, and execution capabilities in minutes.

Embedded Example

Set up your schemas/tenants on Rulebricks, and in just a few lines of code, our embeddable decision table editor helps you build and orchestrate:

  • Customer portals – Let customers configure their own business rules
  • Partner integrations – Provide rule editing to external partners
  • Internal tools – Embed rule management in admin dashboards

Also see our Node SDK for management functionality.

NPM Version


Installation

npm install @rulebricks/embedded

Quick Start

1. Generate a token (server-side)

Using the helper function:

import { createEmbedToken } from "@rulebricks/embedded/server";

const { token } = await createEmbedToken({
  apiKey: process.env.RULEBRICKS_API_KEY,
  // Get this from your dashboard URL, or published URL slug
  ruleId: "your-rule-id",
  baseUrl: "https://rulebricks.com", // or your private instance
});

Or call the API directly:

const response = await fetch("https://rulebricks.com/api/embed/token", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": process.env.RULEBRICKS_API_KEY,
  },
  body: JSON.stringify({
    ruleId: "your-rule-id",
    expiresIn: 3600, // seconds
  }),
});

const { token } = await response.json();

2. Render the component (client-side)

import { Rule } from "@rulebricks/embedded";

function App() {
  return (
    <Rule
      embedToken={token}
      height={600}
      onPublish={(e) => console.log("Published:", e.rule)}
      onError={(e) => console.error(e)}
    />
  );
}

Props

It is important to note that most UI customization still needs to be done in the Rulebricks dashboard, particularly management around organization branding, user tenancy, and roles.

Your embeds will always inherit these settings, and users will only be able to work with rules that they have permission to view/edit, and in ways their role allows.

| Prop | Type | Default | Description | | ----------------- | ---------- | ------------------------ | ----------------------------- | | embedToken | string | required | Token from your backend | | apiBaseUrl | string | window.location.origin | Rulebricks instance URL | | height | number | 600 | Container height in pixels | | showFooter | boolean | true | Show bottom status bar | | showControls | boolean | true | Show top navbar | | showRowSettings | boolean | false | Show row settings gear icon | | onPublish | function | – | Called when rule is published | | onError | function | – | Called on errors |

How It Works

sequenceDiagram
    participant C as Your App (Client)
    participant S as Your Backend (Server)
    participant R as Rulebricks API

    C->>S: 1. Request token
    S->>R: 2. Generate token (with API key)
    R-->>S: Returns embed token
    S-->>C: 3. Return embed token
    C->>R: 4. Load Rule component (with token)
    R-->>C: 5. Rule data + permissions

License

Elastic License 2.0