BilldogEng.Messaging (BilldogEng v1.0.0-beta.1)

Copy Markdown View Source

Messaging dispatch (BillDog advantage over PostHog) — server-side delivery across push / email / sms / in-app / live-activity.

Note: messaging-dispatch authenticates with a Supabase session Bearer JWT + project membership, not the x-api-key key used by the other modules. Pass the JWT as :access_token per call.

Mirrors the Node SDK messaging.ts.

Summary

Functions

Dispatch a message. Returns {:ok, %{"sent" => .., "failed" => ..}} (or a {:error, ...} envelope when no recipients match).

Functions

dispatch(client, params)

@spec dispatch(
  BilldogEng.t(),
  keyword()
) :: {:ok, term()} | {:error, BilldogEng.Error.t()}

Dispatch a message. Returns {:ok, %{"sent" => .., "failed" => ..}} (or a {:error, ...} envelope when no recipients match).

Required params (keyword list):

  • :project_id — project UUID
  • :channel — one of push|email|sms|in-app|live-activity
  • :content — channel-specific content map
  • :access_token — Bearer JWT

Optional: :targeting, :scheduling, :template_id.