SocialHub.AI
リソース · 開発者センター

Webプッシュ

オープンな Web プッシュ プロトコル を使用してブラウザでメンバーにアクセスできます。アプリや有料のサードパーティ プロバイダー、メッセージごとの料金は必要ありません。 Flash は有効にするとワークスペースの VAPID キーを自動生成し、メンバーはポータルからサブスクライブし、すべてのメッセージはサブスクリプション独自のキーで暗号化されます。

仕組み

オープンスタンダード、プロバイダーなし

Web プッシュは、各ブラウザのプッシュ サービスを介して、ブラウザ独自の Web プッシュ プロトコルで実行されます。有料のサードパーティ プッシュ ベンダーやメッセージごとの料金はありません。

VAPID キー、自動生成

最初に有効にすると、Flash によってワークスペースの VAPID アプリケーション サーバー キーが生成されます。手動で作成、貼り付け、回転する必要はありません。

メンバー主導の購読

メンバーはポータルのプライバシー ページから自分で購読します。ブラウザー独自の許可プロンプトによってゲートが制御されます。許可もサブスクリプションもありません。

サブスクリプションごとの暗号化

各プッシュ ペイロードは個々のサブスクリプションのキーに暗号化されるため (RFC 8291 メッセージ暗号化)、そのメンバーのブラウザーのみがそれを読み取ることができます。

有効にする (管理者)

管理者がワークスペースの Web プッシュをオンにします。生成するキーはありません。Flash は、最初の有効化時に VAPID アプリケーションとサーバーのキーペアを作成します。

// Admin enables web push for the workspace in Settings → Web Push.
// On first enable, Flash GENERATES the VAPID application-server keypair automatically —
// you don't create or paste keys. You set a contact email and can fire a test send.
//
//   Settings → Web Push:
//     • Enable web push            (OFF by default, per workspace)
//     • Contact email              (identifies the sender to the browser push services)
//     • Send test notification     (verify the end-to-end path)
//
// The public VAPID application server key is what the member's browser uses when it
// creates a push subscription (below).

会員登録の流れ

メンバーのブラウザは、ワークスペースの公開 VAPID キーを使用してサブスクリプションを作成します。ポータルはそれを Flash に投稿します。これが依存するサインインしたコンシューマー セッションについては、メンバー ポータルの埋め込み ガイドを参照してください。

// Members subscribe THEMSELVES from the member portal privacy page. The web-push card
// only renders when (a) the browser supports the Push API AND (b) the workspace enabled
// web push. Tapping it triggers the browser's native permission prompt.
//
//   1. Portal registers a service worker.
//   2. Browser creates a PushSubscription using the workspace's public VAPID key
//      (Notification.requestPermission() → pushManager.subscribe(...)).
//   3. The portal posts that subscription (endpoint + p256dh + auth keys) to Flash:
POST https://flash.socialhub.ai/api/member/web-push
Content-Type: application/json

{
  "endpoint": "<browser push service endpoint>",
  "keys": { "p256dh": "<client public key>", "auth": "<client auth secret>" }
}
// → 200  { data: { ok: true } }
//   GET  https://flash.socialhub.ai/api/member/web-push   → the workspace public key + whether web push is on
//   DELETE https://flash.socialhub.ai/api/member/web-push  { "endpoint": "..." }  → unsubscribe
//   The member identity comes from the signed-in member session — never the body.

配信: API 呼び出しではなくチャネル

// You do NOT call a "send web push" endpoint directly. Web push is a CHANNEL in the
// same send/automation stack as email and app push. When a campaign or journey targets
// a subscribed member:
//
//   • Flash encrypts the payload to that member's subscription keys (RFC 8291) and
//     hands it to the member's own browser push service for delivery.
//   • Subscriptions that the push service reports as gone/expired are pruned
//     automatically, so you don't keep sending into dead endpoints.

知っておいてよかった

Push API と Service Worker をサポートする最新のブラウザで動作します。ポータルはブラウザがサポートするオプトイン カードのみを提供するため、ブラウザで使用できないチャネルがメンバーに表示されることはありません。

デフォルトでは無効になっており、ワークスペースごとに設定されています。管理者が有効化し、メンバーがブラウザ経由でオプトインするまで、何も送信されません。

サブスクリプションのキーはメンバーのブラウザによって提供されます。 Flash は、各メッセージを暗号化するためにそれらを保存し、ワークスペース間で共有することはありません。

関連: アプリのプッシュ · メンバー ポータルの埋め込み · コンプライアンスと同意 API

Web プッシュを接続していますか?

Service Worker + VAPID サブスクライブ フロー、送信チャネル スタック、またはサブスクリプションごとのメッセージ暗号化については、エンジニアにご相談ください。

エンジニアリングに相談する