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

@objectstack/plugin-org-scoping

v9.3.0

Published

Organization-Scoping Plugin for ObjectStack — row-level Organization isolation, per-org seed replay, default-org bootstrap

Downloads

4,469

Readme

@objectstack/plugin-org-scoping

Row-level Organization isolation for ObjectStack — the LOGICAL multi-tenant building block.

@objectstack/plugin-org-scoping makes sys_organization a first-class row-level scope:

  • Insert auto-stamp — fills organization_id from ExecutionContext.tenantId on every authenticated insert (when the target object declares the column).
  • Per-org seed replay — every sys_organization insert triggers a copy of the app's demo dataset into the new org (via seed-replayer, or fallback claimOrphanOrgRows / cloneOrgSeedData).
  • Default-org bootstrap — the first platform admin gets a Default Organization (slug default) bound as owner on kernel:ready, so the dashboard isn't empty after first sign-up.

Pair with @objectstack/plugin-security for full multi-tenant RBAC + RLS + Field-Level Security. Standalone install gives a single-tenant deployment.

Naming

The word "tenant" in ObjectStack means physical isolation (one Environment = one database, per ADR-0002 and @objectstack/driver-turso's multi-tenant router). This plugin is about logical row-level scoping inside a single database — orthogonal to physical tenancy. Hence "org-scoping", not "multi-tenant".

Install

pnpm add @objectstack/plugin-org-scoping @objectstack/plugin-security

Usage

import { OrgScopingPlugin } from '@objectstack/plugin-org-scoping';
import { SecurityPlugin } from '@objectstack/plugin-security';

// OrgScopingPlugin MUST be registered BEFORE SecurityPlugin — the
// latter probes `getService('org-scoping')` at start time to decide
// whether to keep wildcard `current_user.organization_id` RLS policies.
await kernel.use(new OrgScopingPlugin());
await kernel.use(new SecurityPlugin());

Or via the OS_MULTI_TENANT env switch when using @objectstack/runtime / @objectstack/plugin-dev:

OS_MULTI_TENANT=true objectstack serve

Options

new OrgScopingPlugin({
  ensureDefaultOrganization: true, // default — auto-create slug="default" for first admin
});

Set ensureDefaultOrganization: false to fully self-manage onboarding via invitations / a custom UI.

See also

  • ADR-0002 — Physical multi-tenancy & driver-turso router
  • @objectstack/plugin-security — RBAC, RLS, Field-Level Security