Vercel Artifacts
Vercel Artifacts API requests at https://api.vercel.com/v8/artifacts authenticated with a bearer token. The cache key, team or owner scope query, endpoint, and artifact headers stay with the caller.
Inserts a sensitive Authorization: Bearer header and leaves the URI and every other header unchanged; expires_in is rejected because the Vercel Remote Cache API has no query authentication.
Get started
cargo add reqsign --features vercel
use reqsign::{default_context, vercel};
// TURBO_TOKEN, then VERCEL_ARTIFACTS_TOKEN — resolved by the default chain.
let ctx = default_context();
let signer = vercel::default_artifacts_signer(ctx);
let mut req = http::Request::builder()
.method(http::Method::PUT)
.uri("https://api.vercel.com/v8/artifacts/example-hash?teamId=team_example")
.body(())?
.into_parts()
.0;
// Sign in place, then send with the HTTP client you already use.
signer.sign(&mut req, None).await?;
The signer inserts Authorization: Bearer <token>, which is how the Vercel
Artifacts API authenticates Remote Cache calls.
Credential discovery
The default chain reads:
TURBO_TOKENthroughContextenvironment access. Turborepo documents it as the bearer token for Remote Cache access.VERCEL_ARTIFACTS_TOKENthroughContextenvironment access. Vercel injects it into its build environments.
When both are present, TURBO_TOKEN is tried first; the Vercel-injected variable
is the build-environment fallback. Vercel's OIDC token exchange for CI produces a
short-lived Turborepo access token; Reqsign accepts that token but does not
perform the exchange.
TURBO_TEAM, TURBO_TEAMID, and VERCEL_ARTIFACTS_OWNER are not read. They
describe the cache scope rather than the identity, so the caller adds them as the
teamId or slug query parameter.
A present but unusable token, or an invalid prepended or static provider, fails
signing instead of silently selecting a different identity. An absent token
yields no credential, and signing then reports CredentialInvalid.
Cache key and scope stay with the caller
The signer preserves the URI. The caller chooses the API endpoint, the cache key
in /v8/artifacts/<hash>, the team or owner scope query, and artifact headers such
as x-artifact-duration.
The default API host is https://api.vercel.com; self-hosted Remote Cache
implementations and a caller-selected endpoint remain outside Reqsign.
Request behavior
ArtifactsRequestSigner inserts a sensitive Authorization header and leaves the
URI and every other header unchanged. The Vercel Remote Cache API has no query
authentication, so signing rejects expires_in.
A token is long-lived or refreshed by the caller's CI flow. It carries no expiry that Reqsign can read, and signing writes no protocol time, so signing has no clock dependency. Refresh or rotate it with the mechanism your deployment already uses; an expired token fails at the API.
The caller owns the HTTP client and its redirect policy. Do not forward the
signed Authorization header to a different host.
WASM
Environment and static credentials plus header signing work on
wasm32-unknown-unknown without a JavaScript clock.
Credentials
Default credential chain
The default signer tries these sources in order and uses the first one that yields a credential — no configuration needed when any of them is present:
- TURBO_TOKEN
- VERCEL_ARTIFACTS_TOKEN injected by Vercel
Credential providers
Available ProvideCredential implementations. Construct any of them directly, reorder them, or compose them into your own chain — see Loading credentials:
ArtifactsEnvCredentialProvider— TURBO_TOKENArtifactsVercelEnvCredentialProvider— VERCEL_ARTIFACTS_TOKEN injected by VercelArtifactsStaticCredentialProvider— Static Vercel Artifacts bearer token