AbsoluteJS

@absolutejs/dispatch-push-postgres

@absolutejs/dispatch-push-postgresv0.2.0betaMessaging

Durable PostgreSQL device registry and fenced fanout claims for @absolutejs/dispatch push lifecycle.

#Installation

BASH
bun add @absolutejs/dispatch-push-postgres

#Capabilities

Overview

Production persistence for the provider-neutral push lifecycle in @absolutejs/dispatch.

The store supports APNs, FCM, and structured Web Push subscriptions. Its schema is additive: applying the current schema upgrades existing native-only tables, backfills their credential identity, and keeps native token rows intact.

It stores tenant-isolated device registrations, user/device/topic targeting state, invalid-token retirement, and fenced idempotent fanout claims. Apply both exported schemas, then compose the stores with createPushLifecycle.

Show 1 more

Registration is atomic across a stable (tenant, platform, deviceId) identity and provider credential (native token or Web Push endpoint). Credential rotation retains the subscription identity and removes superseded records inside the same fenced transaction.

Outcomes

What you can build

Build on the supported package contract

Use @absolutejs/dispatch-push-postgres through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/dispatch-push-postgres version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical @absolutejs/dispatch-push-postgres example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#@absolutejs/dispatch-push-postgres quick start

Partial snippet

# @absolutejs/dispatch-push-postgres

TS
import { createPushLifecycle } from "@absolutejs/dispatch";
import {
  createPostgresPushSubscriptionStore,
  createPostgresPushFanoutClaimStore,
} from "@absolutejs/dispatch-push-postgres";
import {
  createPostgresIdempotentOperationStore,
  createPostgresTransactionRunner,
} from "@absolutejs/reliability";

const runner = createPostgresTransactionRunner(pool);
const lifecycle = createPushLifecycle({
  adapterFor: ({ platform, tenant }) => resolveTenantAdapter(tenant, platform),
  claimStore: createPostgresPushFanoutClaimStore(
    createPostgresIdempotentOperationStore(runner),
  ),
  store: createPostgresPushSubscriptionStore(runner),
});

#Public entry points

Supported entry points declared by this package manifest.

Package entry point declared in package.json.

@absolutejs/dispatch-push-postgres@absolutejs/dispatch-push-postgres/manifest@absolutejs/dispatch-push-postgres/manifest.json

#Package commands

Scripts declared by this package manifest.

bun run buildrm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/dispatch --external '@absolutejs/dispatch/*' --external @absolutejs/manifest --external @absolutejs/reliability --external @sinclair/typebox && tsc --project tsconfig.build.json && absolute-manifest emit
bun run check:packagebun run format && bun run typecheck && bun run test && bun run verify-package && bun run build
bun run formatprettier --write "./**/*.{ts,json,md}"
bun run testbun test
bun run typechecktsc --noEmit