HowlCastHowlCast
Reference

tRPC routes

Every router and procedure HowlCast exposes.

All tRPC routers live in packages/api/src/routers/. The browser hits them via /api/trpc/* rewritten through the web worker → api worker.

Three procedure types:

  • Public — anyone can call
  • Protected (broadcaster)assertBroadcaster runs first
  • Protected (any signed-in) — Better Auth session required

setup

First-run wizard.

ProcedureTypePurpose
getStatuspublicReturns { setupCompleted, broadcasterTwitchId? }
lookuppublicTwitch Helix lookup + 7TV/BTTV/FFZ counts (preview)
commitpublicCreates broadcaster account, locks setup, sets cookie

commit is locked by a single read of setupCompletedAt — once set, returns 409.

channel

Public reads + broadcaster-only writes.

ProcedureTypePurpose
getInfopublicDisplay name, title, verified, etc.
getPanelspublicSorted panel list
getEmotespublicMerged emote map from KV
createCallbroadcasterFirst-time GetStream provisioning
updateConfigbroadcasterTitle (autosave on blur)
upsertPanelbroadcasterAdd or edit a panel
deletePanelbroadcasterHard delete
reorderPanelsbroadcasterSends id-ordered array
refreshEmotesbroadcasterManual emote pipeline kick

stream

Live state + tokens + analytics.

ProcedureTypePurpose
isLivepublicPolled by channel page every 10s
getStreamCredentialspubliccallId + chatChannelCid + apiKey
getViewerTokenpublicShort-lived viewer JWT
getBroadcasterTokenbroadcasterLong-lived broadcaster JWT (= OBS key)
provisionbroadcasterProvisions GetStream call, sets RTMPS
goLivebroadcasterTells GetStream to flip live
stopLivebroadcasterTells GetStream to end
getStatsbroadcasterLast 7d aggregates + session list
getSessionDetailbroadcasterPer-session viewer + chat charts data

admin

Invites + webhook config + profile.

ProcedureTypePurpose
listWebhooksbroadcasterTwo Discord webhook rows
upsertWebhookbroadcasterURL + per-event toggles
createInvitebroadcasterGenerates code, sends magic-link
listInvitesbroadcasterOutstanding + used + revoked
acceptInvitepublicFlips is_invited
revokeInvitebroadcasterSets revoked_at
updateProfilebroadcasterDisplay name, bio, pronouns

branding

White-label + legal docs.

ProcedureTypePurpose
getpublicResolved white-label values
updatebroadcasterLogo key, platform name, footer
getLegalpublicPrivacy or Terms HTML
updateLegalbroadcasterSave sanitized HTML from Tiptap

account

Viewer / broadcaster account management. Lives in packages/api/src/routers/account.ts.

ProcedureTypePurpose
getMeany signedProfile + sessions list
updateMeany signedDisplay name, pronouns, etc.
deleteMeany signedHard delete with FK guards

deleteMe precondition: cannot delete if you're the broadcaster on channel_config. Schema FK has no cascade for that case.

Next: Webhooks.

On this page