set_secret
Store a credential once and refer to it instead of pasting it into requests: put {{secret:NAME}} in a header value of schedule_http, create_cron, watch_http or set_wake, e.g. "Authorization": "Bearer {{secret:GITHUB_TOKEN}}". RunLater encrypts the value, fills it in only at the moment it sends, and only to allowed_hosts: a request to any other host is refused, so a tricked or mistaken call cannot leak it. The value is never returned by any call, and if a destination echoes it back as sent, JSON-escaped or URL-encoded, a captured response shows [secret:NAME] instead (best effort: other encodings are not caught). Calling again with the same name replaces the value and hosts; work that refers to it uses the new value from its next attempt. At most 50 secrets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The secret's name, e.g. "GITHUB_TOKEN". | |
| value | Yes | The credential: 16 to 4096 characters of printable ASCII, no line breaks (it is sent in a header). | |
| allowed_hosts | Yes | The exact host names it may be sent to, e.g. "api.github.com". No scheme, port, path or wildcard: under shared domains (workers.dev, amazonaws.com) anyone can get a name, so a wildcard can't be made safe. |