Skip to content

fix(artifacts): align binding docs with workerd types#30030

Merged
mattzcarey merged 1 commit intoproductionfrom
fix/artifacts-binding-docs
Apr 17, 2026
Merged

fix(artifacts): align binding docs with workerd types#30030
mattzcarey merged 1 commit intoproductionfrom
fix/artifacts-binding-docs

Conversation

@mattzcarey
Copy link
Copy Markdown
Contributor

@mattzcarey mattzcarey commented Apr 17, 2026

Aligns Artifacts docs with the canonical types from cloudflare/workerd#6508 and the actual API surface.

Binding docs (workers-binding.mdx)

Issue Before After
create() return type ArtifactsCreateRepoResult & { repo: ArtifactsRepo } ArtifactsCreateRepoResult
get() return type ArtifactsRepo | null (null checks everywhere) ArtifactsRepo (throws on not found)
info() method Documented as repo.info() Removed — ArtifactsRepo extends ArtifactsRepoInfo, metadata is directly on the handle
validateToken() Documented Removed — not in workerd types or binding
import() Missing (docs said 'use REST API') Added with full signature and example
Namespace config No explanation Added comment that any name works
Null checks on get() All examples checked if (!repo) Removed — get() throws
Intro text 'create, list, inspect, or delete' Added 'import'

REST API base URL (all docs)

The REST API examples used artifacts.cloudflare.net/v1/api/... which is not the public API endpoint. Fixed to api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/artifacts/....

Git remote URLs (<account_id>.artifacts.cloudflare.net/git/...) are unchanged — those are correct.

Files fixed: rest-api.mdx, get-started/rest-api.mdx, guides/authentication.mdx, guides/import-repositories.mdx, examples/git-client.mdx

Response field names

Create repo / fork / import responses used expires_at but the actual API returns token_expires_at (verified in response-schemas.ts). Token endpoints correctly use expires_at.

Files fixed: rest-api.mdx (3 responses), get-started/rest-api.mdx, get-started/workers.mdx

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 17, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/artifacts/ @elithrar, @dmmulroy, @mattzcarey, @whoiskatrin, @cloudflare/pcx-technical-writing, @cloudflare/product-owners

devin-ai-integration[bot]

This comment was marked as resolved.

@mattzcarey mattzcarey force-pushed the fix/artifacts-binding-docs branch 2 times, most recently from ac8e943 to 19dd426 Compare April 17, 2026 13:38
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@mattzcarey mattzcarey enabled auto-merge (squash) April 17, 2026 14:16
- create() returns ArtifactsCreateRepoResult (not & { repo })
- get() returns ArtifactsRepo (throws on not found, no null)
- Remove info() — repo metadata is on the handle directly
  (ArtifactsRepo extends ArtifactsRepoInfo)
- Remove validateToken() — not in workerd types or binding
- Add import() — was missing from docs entirely
- Fix expiresAt → tokenExpiresAt in get-started example
- Add namespace note (any name works, not just 'default')
- Remove null checks on get() — it throws, not returns null

Aligned with: cloudflare/workerd#6508
@mattzcarey mattzcarey force-pushed the fix/artifacts-binding-docs branch from 5653b33 to 00dae68 Compare April 17, 2026 14:24
@mattzcarey mattzcarey merged commit c7d3bfb into production Apr 17, 2026
11 checks passed
@mattzcarey mattzcarey deleted the fix/artifacts-binding-docs branch April 17, 2026 14:41
@github-actions
Copy link
Copy Markdown
Contributor

Preview URL: https://00dae680.preview.developers.cloudflare.com
Preview Branch URL: https://fix-artifacts-binding-docs.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/artifacts/api/workers-binding/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/api/workers-binding/
https://developers.cloudflare.com/artifacts/examples/sandbox-sdk-artifacts/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/examples/sandbox-sdk-artifacts/
https://developers.cloudflare.com/artifacts/api/rest-api/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/api/rest-api/
https://developers.cloudflare.com/artifacts/concepts/best-practices/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/concepts/best-practices/
https://developers.cloudflare.com/artifacts/get-started/rest-api/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/get-started/rest-api/
https://developers.cloudflare.com/artifacts/guides/import-repositories/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/guides/import-repositories/
https://developers.cloudflare.com/artifacts/get-started/workers/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/get-started/workers/
https://developers.cloudflare.com/artifacts/examples/git-client/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/examples/git-client/
https://developers.cloudflare.com/artifacts/guides/authentication/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/guides/authentication/
https://developers.cloudflare.com/artifacts/api/git-protocol/ https://fix-artifacts-binding-docs.preview.developers.cloudflare.com/artifacts/api/git-protocol/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants