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

@batterai/strapi-plugin-canvas

v0.1.0

Published

Installable Strapi 5 plugin for same-origin Canvas authoring.

Readme

@batterai/strapi-plugin-canvas

Installable Strapi 5 plugin for same-origin Canvas authoring.

The admin bundle mounts @batterai/editor-shell directly inside the Strapi admin SPA. Browser calls go through Strapi admin routes and useFetchClient; the package does not import the public render adapter or iframe a dev server.

Minimal Config

export default () => ({
  canvas: {
    enabled: true,
    config: {
      licenseKey: process.env.BATTERAI_CANVAS_LICENSE_KEY,
    },
  },
});

Unlicensed production authoring remains usable with a watermark. Localhost authoring is exempt.

Editor appearance and CMS themes

Canvas inherits its editor chrome colors from Strapi's active Design System theme. This means a project's config.theme.light and config.theme.dark customizations also follow Strapi's user-selected light/dark mode inside Canvas.

For Canvas-specific colors, register an appearance from the Strapi admin customization entrypoint. Use a resolver when light and dark need different values; it receives the currently active Strapi theme and is reevaluated when the CMS theme changes.

// src/admin/app.tsx
import { registerCanvasAppearance } from "@batterai/strapi-plugin-canvas/strapi-admin";

export default {
  register() {
    registerCanvasAppearance((theme) => ({
      accent: theme.colors?.primary600 as string,
      accentStrong: theme.colors?.primary700 as string,
      selection: theme.colors?.primary600 as string,
    }));
  },
};

Supported keys are accent, accentStrong, accentSoft, background, border, borderSubtle, ink, muted, mutedDisabled, panel, panelStrong, and selection. Values must be six-digit hex colors. Canvas applies them as namespaced --be-editor-* custom properties; selection defaults to the blue accent. These tokens style authoring chrome only and are separate from persisted website content.

Register Your Web Component Packages

Canvas includes its built-in block packages. Register additional approved BlockPackage modules from the host app's admin customization file, inside register():

// src/admin/app.tsx
import { registerCanvasBlockPackages } from "@batterai/strapi-plugin-canvas/strapi-admin";
import { acmeBlockPackages } from "./canvas/blocks";

export default {
  register() {
    registerCanvasBlockPackages(acmeBlockPackages);
  },
};

Every package supplies one versioned custom element, its server render path, and block-owned stylesheet URLs. Register packages before the Canvas page mounts (Strapi's register() phase); duplicate block types fail immediately. Each source block belongs in its own folder with block.ts or block.tsx and block.css.

Seed Library

seedLibrary provides the block palette (categories/blocks/presets) written into the plugin's canvas-site document when that document is FIRST created. It is first-creation-only seed data, not a live source: an existing site document's library is never overwritten by config changes — after the first boot the palette lives in Strapi and evolves through the editor (for example saved presets).

// config/plugins.js
module.exports = ({ env }) => ({
  canvas: {
    enabled: true,
    config: {
      licenseKey: env("BATTERAI_CANVAS_LICENSE_KEY"),
      seedLibrary: require("./canvas-library.json"),
    },
  },
});

The value is an object with optional categories, blocks, and presets arrays (any missing key seeds as empty). Block entries need at least type and label; every seeded type must have an installed BlockPackage.

Public Delivery

The plugin exposes a read-only content API route for the visitor website:

GET /api/canvas/delivery

Use it as the SSR host delivery source:

PUBLIC_SITE_DELIVERY_URL=https://cms.example.com/api/canvas/delivery bun run public-site

The delivery route returns published Canvas pages plus published bound collections. Draft/editor data remains behind Strapi admin routes.

Proof

bun run test:strapi-plugin-canvas
bun run strapi-plugin:fresh-install
bun run strapi-plugin:fresh-install:live