Validate a Cloudflare API token, confirm it can access Stream live inputs for the selected account,
and then generate an encrypted &cftoken= parameter for VDO.Ninja.
Example: ee168fc4abe50941832645a0a4fd1adf
Use a token with Account -> Stream -> Edit.
Optional wrapper expiry for the generated cftoken.
Validation checks token status first, then confirms the account can access Cloudflare Stream live inputs.
Cloudflare can create unique WHIP ingest endpoints for each participant, but doing that manually is tedious. This helper encrypts your Cloudflare credentials into a short URL-safe parameter that VDO.Ninja can use to create live inputs on demand.
The token helper does not replace your Cloudflare permissions. If the API token is inactive, expired, scoped incorrectly, or pointed at the wrong account, validation will now tell you that before you send links out.
Cloudflare can mark a token as valid but not usable yet if it has a future not_before time.
Validation reports that directly.
The helper also checks the selected account's live input list and reports the current live input count. That catches the common failures: wrong account ID, missing Stream scope, or an unusable token.
If publish fails later, cloudflare.vdo.ninja now returns the actual Cloudflare API error instead of a generic
JavaScript null-property failure.
The Cloudflare account ID is shown in the dashboard on the relevant account overview pages.
Create an API token from
Cloudflare API Tokens
and grant Account -> Stream -> Edit.
If you want to inspect Stream live inputs directly, use the
Cloudflare dashboard
and open Stream -> Live inputs.
The Stream live inputs API can list how many live inputs already exist, which is useful when cleaning up stale test inputs.
Cloudflare also added API support to disable and re-enable live inputs, so you can pause an input without deleting it.
References: Start a live stream, Live inputs API, Disable or enable live inputs