hibira-io

payload

by hibira-io
Notifications & messaging
v3
^3.0.0
MIT

Overview

Summary generated from the README

Sends a change event to Hibira, a Pusher-compatible realtime service, whenever watched collections or globals are created, updated or deleted. It registers as a Payload plugin and includes a Next.js component that re-renders server components when content changes. A client helper built on pusher-js supports other frontends. Requires Payload 3 and Hibira credentials.

Features

  • Per-collection and per-global change events on public channels
  • Optional document fields included in the event payload, with truncation above 4 KB
  • Draft-aware sending, with an option to also send draft saves
  • LiveRefresh component calling router.refresh with debounced updates
  • useLiveChanges hook and subscribe helper for custom handling
  • Failed sends are logged and never block the save

Use cases

  • Refresh open Next.js pages when an editor publishes changes without making pages dynamic
  • Update live stock or price values on product pages as they change in Payload
  • Notify custom frontends of content changes on serverless hosts without holding a WebSocket open

From the author

Live content updates for Payload CMS on Hibira (Pusher-compatible): publish, update and delete events from collections and globals, and a Next.js component that refreshes the page when its content changes.

Installation

npm i @hibira-io/payload

0

Stars

0

Forks

0

Open Issues

1 weeks ago

Last Updated

15

Weekly Downloads

v0.1.1

npm Version

22.8 KB

Unpacked Size

1

Dependencies

GitHub stars

00 since Oct 25

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 20260
Dec 5, 20260
Dec 4, 20260
Dec 3, 20260
Dec 2, 20260
Dec 1, 20260
Nov 30, 20260
Nov 29, 20260
Nov 28, 20260
Nov 27, 20260
Nov 26, 20260
Nov 25, 20260
Nov 24, 20260
Nov 23, 20260
Nov 22, 20260
Nov 21, 20260
Nov 20, 20260
Nov 19, 20260
Nov 18, 20260
Nov 17, 20260
Nov 16, 20260
Nov 15, 20260
Nov 14, 20260
Nov 13, 20260
Nov 12, 20260
Nov 11, 20260
Nov 10, 20260
Nov 9, 20260
Nov 8, 20260
Nov 7, 20260
Nov 6, 20260
Nov 5, 20260
Nov 4, 20260
Nov 3, 20260
Nov 2, 20260
Nov 1, 20260
Oct 31, 20260
Oct 30, 20260
Oct 29, 20260
Oct 28, 20260
Oct 27, 20260
Oct 26, 20260
Oct 25, 20260
npm weekly downloads

15+15 since Oct 31

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 202615
Dec 5, 202613
Dec 4, 202614
Dec 3, 202619
Dec 2, 202624
Dec 1, 202618
Nov 30, 202618
Nov 29, 202615
Nov 28, 202614
Nov 27, 202613
Nov 26, 20269
Nov 25, 20263
Nov 24, 20263
Nov 23, 20263
Nov 22, 20267
Nov 21, 202615
Nov 20, 202621
Nov 19, 202626
Nov 18, 202631
Nov 17, 202637
Nov 16, 202647
Nov 15, 202651
Nov 14, 202646
Nov 13, 202665
Nov 12, 202673
Nov 11, 202682
Nov 10, 202682
Nov 9, 2026271
Nov 8, 2026544
Nov 7, 2026541
Nov 6, 2026516
Nov 5, 2026502
Nov 4, 2026487
Nov 3, 2026480
Nov 2, 2026281
Nov 1, 20260
Oct 31, 20260

Each point is npm's rolling 7-day download count.

Health Score

68/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1439914368-root.svg)](https://payloaddirectory.dev/plugins/1439914368-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1439914368-root"><img src="https://payloaddirectory.dev/badge/1439914368-root.svg" alt="Payload Directory"></a>
Updated Nov 25, 2026Created Oct 30, 2026Published Oct 31, 2026

README

@hibira-io/payload

@hibira-io/payload

npm ci

Live content for Payload CMS 3 on Hibira, a hosted realtime service that speaks the Pusher Channels protocol. When an editor publishes, updates or deletes something, every open page that shows it refreshes by itself.

  • A Payload plugin that sends a change event when watched collections and globals change, without blocking or failing the save.
  • <LiveRefresh> for Next.js: re-renders the page's server components with router.refresh() when its content changes. Pages stay static or cached.
  • subscribe() for any other frontend, on pusher-js.

Your server never holds a WebSocket open, so it works on Vercel and other serverless hosts.

Install

npm install @hibira-io/payload pusher-js

Create a free app at hibira.io (no card), and put its credentials in .env:

HIBIRA_APP_ID=
HIBIRA_APP_SECRET=
NEXT_PUBLIC_HIBIRA_APP_KEY=
# NEXT_PUBLIC_HIBIRA_HOST=ws.hibira.io

Send events

// payload.config.ts
import { buildConfig } from 'payload';
import { hibiraPlugin } from '@hibira-io/payload';

export default buildConfig({
  // ...
  plugins: [
    hibiraPlugin({
      collections: {
        posts: true,
        products: { fields: ['price', 'stock'] },
      },
      globals: { header: true },
    }),
  ],
});

Each change goes to these channels:

ChannelFor
payload-{collection}lists: any document in the collection
payload-{collection}-{id}one document
payload-global-{slug}a global

The event is change:

{ "collection": "products", "id": 12, "operation": "update", "updatedAt": "2026-10-29T08:00:00.000Z", "doc": { "price": 980, "stock": 3 } }

operation is create, update or delete. By default the event carries no document fields; list the ones you want in fields. Channels are public, so only list fields any visitor may see. Data larger than 4 KB (the free plan's limit) is left out and truncated: true is set.

With drafts on, events go out only when the published content changes: publishing, or saving a published document. drafts: 'all' sends draft saves too, for admin tools. Unpublishing is not reported.

Options:

OptionDefault
appId, key, secretHIBIRA_APP_ID, HIBIRA_APP_KEY or NEXT_PUBLIC_HIBIRA_APP_KEY, HIBIRA_APP_SECRETcredentials
host, port, useTLSws.hibira.io, 443, trueanother cluster or a self-hosted server
collections, globalsnone{ slug: true } or { slug: { fields, drafts, channels } }
channels(doc)nonemore channels per event, such as author-${doc.author}
prefixpayloadchannel name prefix
waittruefalse sends in the background (may be cut off on serverless)
enabledtrue

To skip events for one operation, such as an import:

await payload.update({ collection: 'posts', id, data, context: { hibira: false } });

If Hibira cannot be reached, the error is logged with Payload's logger and the save goes through.

Refresh Next.js pages

// app/(frontend)/posts/[slug]/page.tsx
import { LiveRefresh } from '@hibira-io/payload/react';

export default async function Post({ params }) {
  const post = await getPost((await params).slug);
  return (
    <article>
      <LiveRefresh collection="posts" id={post.id} />
      <h1>{post.title}</h1>
      ...
    </article>
  );
}

<LiveRefresh collection="posts" /> refreshes on any change in the collection (a list page), and <LiveRefresh global="header" /> on changes to a global. Several changes within 300 ms (delay) make one refresh. For your own handling:

'use client';
import { useLiveChanges } from '@hibira-io/payload/react';

useLiveChanges({ collection: 'products', id }, (e) => setStock(e.doc?.stock));

Other frontends

import { connect, subscribe } from '@hibira-io/payload/client';

const pusher = await connect({ key: 'your-app-key' });
const stop = subscribe(pusher, { collection: 'posts' }, (e) => console.log(e.operation, e.id));

How much it costs

Each change is one message, however many pages receive it. Each open page is one connection. The free plan has 100 connections and 200,000 messages a day.

Develop

npm test   # unit tests
# A real Payload (SQLite) against a Hibira-compatible server:
HIBIRA_E2E_APP_ID=... HIBIRA_E2E_KEY=... HIBIRA_E2E_SECRET=... HIBIRA_E2E_HOST=ws.hibira.io npm test

License

MIT

Similar plugins