Skip to content

Integration: Cloudflare Stream & Images

Used by FinFluencify for DRM-protected course video and thumbnails.

Components

ServicePurpose
Cloudflare StreamHosts and encodes course videos; signed playback tokens for enrolled students.
Cloudflare ImagesCourse thumbnails via the Variants API.

Public account codes and URL builders live in src/tiers/users/features/finfluencify/config/cloudflareConfig.js (buildStreamPlayerUrl, buildImageUrl, etc.). The global buildImageUrl() also exists in src/config/cloudinaryConfig.js.

Upload flow (direct creator upload)

Secrets

CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_STREAM_API_TOKEN, CLOUDFLARE_STREAM_WEBHOOK_SECRET — see Environment Variables.

Webhook resilience

finfluencify-stream-webhook verifies an HMAC signature with a timestamp replay window and constant-time comparison, then upserts into finfluencify_stream_webhook_events (event_id UNIQUE) so Cloudflare retries are idempotent. This is the reference pattern for any new webhook receiver.