Token VaultDocs
Your Webhook

Update your webhook

Pull in the latest reference webhook release with the Cloudflare update Action, a manual script, or a Docker redeploy.

Updating is an in-place redeploy of the reference webhook (c-lgrant/tvault, examples/webhook). No migration, no re-keying, no URL change. Your credentials and seed survive, and the webhook upgrades its own storage schema on the next start.

The web app tells you

When your bound webhook lacks a capability the latest release needs, the web app shows an update banner that links here. You can also watch the releases page.

Which version am I on?

The webhook spec is at 2.12.0. The reference webhook reports the spec version that it implements. Check what your webhook advertises:

curl -s https://your-webhook.example.com/v1/health

Capabilities the latest release expects: store, credential, proxy, refresh, storage, totp, ticketConstraints, oauth-callback. tv-refresh is not on the list because it is your choice. Connecting your own OAuth app needs oauth-callback; the Add flow says "Your webhook does not support connecting with your own OAuth app yet" when it is missing.

Upgrading from 0.13 or earlier

After the update, tokens connected through Token Vault's own Google, GitHub or Spotify apps stop refreshing unless TV_REFRESH_ENABLED=true is set on the webhook. Set it before you deploy if you still use those tokens. Then press Verify Connection in Settings so Token Vault re-reads the capabilities. Tokens connected with your own OAuth app are not affected.

What changes when you update

  • Legacy tv-refresh is off by default. See the note above and Token refresh.
  • /v1/proxy refuses private addresses (spec 2.12.0). If an MCP server of yours is on your own network, set TV_PROXY_ALLOW_PRIVATE=true before you update. Token Vault itself only accepts public MCP server URLs, so most webhooks need no change.
  • You can bind each credential to the origins you trust. Set TV_PROXY_ALLOWED_ORIGINS and your webhook sends a credential only to an origin on the list, whatever Token Vault asks for. It is off until you set it. See Self-host.
  • One-shot tickets are atomic on Workers. Each ticket nonce is one row in your D1 database. The cron trigger removes expired rows, and the Worker also removes them by itself about every 10 minutes. The update keeps your wrangler.toml, so a Worker deployed before the cron trigger existed has none: add [triggers] with crons = ["*/10 * * * *"] to get the scheduled OAuth refresh too. This is one D1 row write for each credential read, store and MCP call. On the D1 free plan (100,000 rows written a day), set TV_REPLAY_NONCES="cache" if you get near that limit.
  • /v1/storage returns metadata only for a credential. Token Vault can no longer read a stored credential document, encrypted or not.
  • An OAuth connect that is in progress during the update fails once. The PKCE verifier now comes from a key that only your webhook holds. Start the connect again.
  • Agents no longer get the refresh token from /v1/credential. Your webhook still refreshes the credential. An agent that renewed a token itself with the refresh token must fetch the credential again instead. Your own reveal in Token Vault still shows the refresh token.

Cloudflare deploy-button path

If you deployed with the "Deploy to Workers" button, your repo has an Update webhook GitHub Action.

One-time: let Actions open PRs

GitHub blocks this on a new repo, so the first run fails with "GitHub Actions is not permitted to create or approve pull requests". Settings > Actions > General > Workflow permissions > Allow GitHub Actions to create and approve pull requests. Or:

gh api -X PUT repos/<you>/<your-webhook-repo>/actions/permissions/workflow \
  -f default_workflow_permissions=read -F can_approve_pull_request_reviews=true

Run it

Actions > Update webhook > Run workflow. It opens a PR named chore: update webhook to <version>. Review the diff and merge. Workers Builds redeploys against your existing D1 database and seed.

The Action does not touch wrangler.toml, .dev.vars or secrets. If a release adds a variable, add it by hand. Adopting your own OAuth app means adding the OAUTH_PROVIDERS_JSON secret yourself. Workflow files under .github/workflows/ cannot be auto-updated; the PR body names any that changed.

Manual path

From a clone of your webhook repo:

# stage outside the repo so `git add -A` does not commit the tarball
up=$(mktemp -d)
curl -fsSL https://codeload.github.com/c-lgrant/tvault/tar.gz/refs/tags/<tag> -o "$up/up.tgz"
tar -xzf "$up/up.tgz" -C "$up" --strip-components=1
node scripts/apply-update.mjs "$up/examples/webhook" .
git checkout -b chore/update-webhook && git add -A && git commit -m "chore: update webhook to <tag>"
git push origin chore/update-webhook      # PR, review, merge, auto-deploy
rm -rf "$up"

Replace <tag> with a release from the tvault releases page.

Docker

Pull the newer examples/webhook from the repo and rebuild with docker compose up -d --build. It must use the same persisted volume. That volume holds your keys, so reusing it keeps the binding alive. The webhook applies schema changes on boot.

Keep your keys

On Cloudflare Workers, never regenerate or lose TV_WEBHOOK_SEED. Your HMAC signing key and, if you encrypt at rest, the encryption key derive from it. On Docker and Node there is no seed: back up the /data volume, which holds the generated keys. Lose them and stored credentials cannot be decrypted. Token Vault has no copy.

Check it worked

Open Settings > Webhook > Health and run the tests. If something fails, see Webhook unreachable.

On this page