Introducing Stream Bindings for Workers
Key Points
- Stream Bindings eliminate authenticated API calls for video operations
- Generate signed playback tokens and manage metadata programmatically
- Integrate AI video generation with Stream uploads in Workers
Summary
Cloudflare has introduced Stream Bindings for Workers, enabling programmatic interaction with your Stream video library directly from Workers. This eliminates the need for authenticated API calls and supports video uploads, direct uploads, metadata management, and signed URL generation.
Key Points
- Upload videos from URLs or create direct upload links for end users without API authentication
- Generate signed playback tokens without managing signing keys
- Manage video metadata, captions, downloads, and watermarks programmatically
- Build complete video pipelines within Workers
- Integrate with AI inference workloads (e.g., generate videos with Veo-3.1 and upload directly to Stream)
Getting Started
Add the Stream binding to your wrangler.toml or wrangler.jsonc:
[stream]
binding = "STREAM"
Then use the binding in your Worker code to upload videos, generate tokens, and manage video properties via simple method calls like env.STREAM.upload(), env.STREAM.video(id).generateToken(), and env.STREAM.video(id).update().