FluxyChat

Core SDK

Notifications

Web push, user channel events, and in-app alerts.

Push and in-app notifications use Worker-configured VAPID keys and the user-channel WebSocket.

Web push

import { useWebPush } from "@fluxy-chat/react";

import type { FluxyChatClient } from "@fluxy-chat/sdk";

function PushSettings({ client }: { client: FluxyChatClient }) {
  const { permission, requestPermissionAndSubscribe, unsubscribe } = useWebPush(client);

  if (permission === "unsupported") return null;

  return (
    <button onClick={() => requestPermissionAndSubscribe()}>
      {permission === "granted" ? "Push enabled" : "Enable push"}
    </button>
  );
}

Configure VAPID keys in Worker secrets / .dev.vars:

VAPID_PUBLIC_KEY=...
VAPID_PRIVATE_KEY=...

See Web push (VAPID).

User channel

useNotifications and useUserChannel subscribe to per-user realtime events (inbox refresh, mentions, system alerts):

import { useNotifications } from "@fluxy-chat/react";

useNotifications({ client, onEvent: (event) => console.log(event) });

Delivery types

ChannelMechanism
In-appUser channel WS + inbox
Web pushBrowser Push API + Worker delivery
Email / SMSWorker integrations (tenant-configured)

Member JWT required for subscription registration.

On this page