Skip to content

Sites

A site is one of two things, each at an address of its own:

  • A brand portal, drawn by Artbucket: the collections and brand pages you pick, in the brand’s theme (Portals).
  • A built site: guidelines, a landing page, docs or a Storybook you build with your own tools (Claude, Lovable, a static site generator), deployed as a folder of static files.

Both live under Sites in the sidebar and at /api/v1/sites. Agents manage them with create_site, update_site, list_sites, close_site and delete_site. Making or deploying a site takes write on the project.

artbucket site new makes a site from the brand in one step: plain HTML and a build script with the CLI and the kit, for a landing page, docs or guidelines. artbucket site eject starts one from the brand’s own pages instead (Eject to code). --create makes the site in Artbucket too, for members until you open it.

Terminal window
npx artbucket site new acme-docs --brand acme --kind docs --create
cd acme-docs
npm install
npm run deploy

npm run deploy exports the release of the brand that readers see, never the draft, builds dist/ from it and deploys it. Its colors, faces and logo come from the brand’s rules, its text from rules such as brand.headline, and the files it shows are copied in, so the check knows each one and the site shows in its lineage. Change the files as you like: they are yours, under the MIT License (its notice is the site’s LICENSE), and the README in the folder says how the pages bring in the brand.

The export works with any framework as well:

Terminal window
artbucket brand export .brand --brand acme

writes .brand/brand.json (the release’s rules, each file with its path), .brand/tokens.css (every rule as a custom property, and @font-face for its faces) and the files under .brand/assets/, ready for a build to read offline. --release 12 exports that release instead. On the API, it is GET /api/v1/brand/rules?version=live and GET /api/v1/brand/tokens?version=live: only the files that may leave the team come with a release.

A deployment is a zip of the build: index.html at its root, or in the one folder it wraps (a zip of dist/ works as is). Hidden files and __MACOSX are left out. Drop it on the site in Sites, push it from a terminal, or send it to the API:

Terminal window
artbucket site push dist --site acme-docs
Terminal window
curl -X POST "https://app.example.com/api/v1/sites/{id}/deployments?path=/" \
-H "Authorization: Bearer $ARTBUCKET_KEY" \
-H "Content-Type: application/zip" --data-binary @dist.zip

It is unpacked, checked and stored, then live. A deployment holds 5,000 files and 200 MB unpacked at most, and its files count toward the organization’s storage, as uploads do. commit and ref in the query record what it was built from.

Each deployment replaces the one live at its path. The last three replaced are kept, so Restore (or POST /api/v1/sites/{id}/deployments/{deployment}/restore) puts one back without building again; older ones, and failed ones, are deleted with their files.

On a server with a build integration (SITE_BUILD_URL, see Environment), a site’s Deployments offer Build from GitHub: the integration builds the site from its repository on each push, previews each pull request, and deploys through the same API, so every check below applies to its builds too.

A deployment named as a preview is kept beside the live one, never in its place: it answers at {name}--{address}.PORTAL_DOMAIN (pr-12--acme-docs; BUILD_DOMAIN when the server has one), behind the site’s own door, with X-Robots-Tag: noindex so search engines leave it out. A name is lowercase letters, digits and single dashes, 30 at most. Deploying the same name again replaces that preview; a preview is deleted 30 days after it was deployed. One that looks like phishing is refused rather than held. A domain of the site’s own serves its live build only.

Terminal window
artbucket site push dist --site acme-docs --preview pr-12

The API takes preview in the query and answers the deployment with its url. From GitHub Actions, a preview per pull request, its address posted on it:

.github/workflows/preview.yml
on: pull_request
permissions:
contents: read
pull-requests: write
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- id: push
run: echo "url=$(npx --yes artbucket site push dist --site acme-docs --preview pr-${{ github.event.number }} | sed -n 's/^Preview: \([^ ]*\).*/\1/p')" >> "$GITHUB_OUTPUT"
env:
ARTBUCKET_URL: https://app.example.com
ARTBUCKET_KEY: ${{ secrets.ARTBUCKET_KEY }}
- run: gh pr comment ${{ github.event.number }} --edit-last --create-if-none --body "Preview: ${{ steps.push.outputs.url }}"
env:
GH_TOKEN: ${{ github.token }}

A request finds its file, then {path}.html, then {path}/index.html, then the build’s own 404.html with a 404. A folder asked for without its slash gets one (/guide to /guide/), so its page’s relative links resolve under it, as on other static hosts.

A build is served only at the site’s own address: {address}.PORTAL_DOMAIN or a domain of its own, never under /p/ on the app’s address, where its scripts would run beside a signed-in session. It sends its own headers, not the app’s: its scripts run, and it may be framed by itself only. A server without PORTAL_DOMAIN and without a verified domain for the site stores deployments but can’t show them.

With BUILD_DOMAIN set, builds answer at {address}.BUILD_DOMAIN instead (previews at {name}--{address}.BUILD_DOMAIN), and PORTAL_DOMAIN keeps the portals’ own pages: a build runs its owner’s scripts, and on another registrable domain they can’t set cookies a portal reads. A build’s path asked at the portal’s address goes there, and any other path at the build’s address goes to the portal.

An edge in front of the server (a CDN Worker) can serve public builds from storage itself, so a page view never reaches the server. Set EDGE_SECRET on both. The edge asks GET /api/v1/sites/edge?host= with it in X-Edge-Secret and gets the site’s mounts, where each deployment’s files are stored and its redirects and headers, good for ttl seconds (a minute at most); it then answers exactly as the server would, with the same rules (lib/site-serve.ts, a module with no dependencies an edge can bundle). data: null means “pass the request on”: a site behind a password or for members, a closed one, a host the server redirects. The endpoint is not part of the public API.

A build carries its own, in the format Netlify and Cloudflare Pages read, so a site moving here keeps them: a _redirects file and a _headers file at its root.

# _redirects: from, to, status (301 when left out)
/signup https://app.example.com/signup 302
/blog/* /news/:splat
/team/:name /people/:name 308
/app/* /app/index.html 200
/pricing /plans 301!

A rule applies when no file of the build answers the path, or always with !. A 200 serves the build’s own file at the path asked (a single-page app), a 404 serves a page of its own with a 404; the others redirect, keeping the query. :name matches one segment and * the rest, given to the target as :splat. Under a mount such as /docs, a rule’s paths are the build’s own and stay under the mount. Conditions on the query, country, language or role aren’t read: a rule with one is refused.

# _headers: a path, then its headers, indented
/*
Content-Security-Policy: default-src 'self'
/assets/*
Cache-Control: public, max-age=31536000, immutable

Every block whose path matches adds its headers, in the file’s order. A Content-Security-Policy is sent beside the server’s frame-ancestors, so both hold; Cache-Control applies to a public site only. Cookies and the headers that frame the answer (length, encoding, connection, location) are the server’s: a build that sets them is refused. Up to 1,000 redirects and 200 header paths; a file that can’t be read fails the deployment, naming the line. Neither file is served.

A brand portal’s pages stay Artbucket’s, and a build mounts beside them at a path: deploy with ?path=/docs&kind=docs (or --path /docs), and {address}/docs/ is the build while the rest is the portal. Each path has its own live deployment.

A site is public, behind a password, or for members, as a portal is: set it under Who gets in in the site’s panel, or with access on PATCH /api/v1/sites/{id}. A password site’s pages ask for the password first, then open for a week on that browser; a new password closes them again.

A members site’s builds are for the people of its project. They answer at the site’s own address, which the app’s session can’t reach, so a visitor there goes to the app to sign in and comes straight back to the page they asked for, let in on that browser for 12 hours; after that the trip runs again, unseen while they are still signed in. Each page checks again that they may still read the project and that their session in the app stands, so someone removed from the project, or who signs out, is out at once. Anyone else can ask for access there: the site’s admins hear about it, as for a portal, and an approval mails a link that opens the site for as long as the request stands. A members site that is all build answers at {address}.{PORTAL_DOMAIN} or its own domain; a brand portal’s own pages stay at /p/{address} on the app’s, and its builds at its address.

Every deployment is checked against the project’s library before it goes live, with nothing for the build to declare:

  • Its files, by their bytes: a logo copied into dist/ is that logo, whatever its name.
  • Its addresses: every /a/{id} and /c/{id} in its HTML, CSS and JavaScript, on the app’s host or relative. /a/ pins a version; /c/ follows the current one, so it is weighed on the version it serves. Files over 2 MB, such as a large bundle, are matched by their bytes but not read for addresses.
  • Its manifest, when it has one: artbucket.site.json at its root.
{
"brand": "acme",
"release": 12,
"rules": ["color.*", "brand.headline"],
"assets": ["0b6c2f0e-6a52-4a5e-9d3b-1f1a2c3d4e5f"]
}

release and rules say what the build was made from: the brand’s release, and the rules it reads (a key, color.* for a group, * for all). A site that says both isn’t built again for a release that changes none of them (see below).

A pinned link to a replaced, unapproved, archived or expired asset fails the deployment, and so does a copy of one the library says not to use (replaced, refused in review, archived, out of license); a copy of a draft or a deleted asset doesn’t. The message says which file and what replaced it:

logo-2024.png was replaced by logo-2026.png (use 9f1e0d2c-...): img/logo.png is a copy of it

Every id the manifest names must be the project’s. An address of another project’s asset, or another server’s, is left alone: it may well be public. Once live, what the build uses shows in the catalog’s lineage of each asset and of the brand, as built, so you see every site a logo reaches before you replace it. The deployment lists it as uses.

A site you keep on Vercel, Netlify or GitHub Pages gets the same check from its CI, before it deploys there: artbucket site check sends the folder, stores nothing, and exits 1 when the build uses what may not be shown, saying which file and what replaced it. A read key is enough.

# .github/workflows/deploy.yml, after the build step
- run: npx --yes artbucket site check dist
env:
ARTBUCKET_URL: https://app.example.com
ARTBUCKET_KEY: ${{ secrets.ARTBUCKET_KEY }}

POST /api/v1/sites/check takes the same zip, and answers allowed, uses and problems.

A check stores nothing. To have an app you run elsewhere (your product, a site on Vercel) in the catalog, downstream of the components and assets it uses, make it a site of kind Hosted elsewhere (external) and record what it uses from its CI, at the repository’s root. Its page under Sites edits its name, address and description, which the catalog, lineage, Fixes and search show (PATCH /api/v1/sites/{id} with name, url, intro); its address in scans (--site) stays as it was made:

- run: npx --yes artbucket site scan src --site acme-app
env:
ARTBUCKET_URL: https://app.example.com
ARTBUCKET_KEY: ${{ secrets.ARTBUCKET_KEY }}

The CLI reads the code as the bundler would, relative imports and tsconfig’s paths, and finds the components of the project’s Storybooks it imports, each at the version whose code it has; a stories file of several components stands for the files it imports from its own folder. The server reads the files for the library’s assets as it reads a build’s (copies, /a/ and /c/ links, in source as in HTML) and stores nothing but what it found. The scan is the site’s record: in lineage, in Fixes when a component or an asset it uses is replaced, and checked again every day. It exits 1 when something it uses may no longer be.

Packages are followed only when you name them: --packages @acme/ui (a comma-separated list) when the design system ships as one. Its imports count by the names they bring in ({ Button }, or @acme/ui/button), at the version whose code it is when the component’s source is in the repository too (a monorepo), else the current one. A package you didn’t name that brings in two or more components’ names, or one by its path, is pointed out on stderr with the flag to add; the scan goes on without it.

A static site has no server of its own to sign anyone in, take a payment or ship software. So a page that asks for a password, card details or a wallet’s recovery phrase, or a program to download, is what phishing looks like on a free host, and every deployment’s pages are read for those signs (not its scripts: a component library holds login forms legitimately). A page that looks like another company’s sign-in (Microsoft, Google, PayPal, and others phishing copies most) says whose, unless the project holds a brand of that name.

Where the server’s operator reviews (siteReview in the organization’s limits), a build with any sign is held: its files are kept, nothing is served, and the deployment says why. A newsletter form, a page about signing in, or a component library’s bundle is not a sign. Elsewhere it goes live, and the signs stay on the deployment as flags. A held build nobody releases within 14 days is refused.

The operator hears of it at SITE_REVIEW_EMAIL, and decides in the database:

-- What waits
select d.id, o.slug as organization, p.slug as site, d.path, d.flags, d.prefix, d.created_at
from site_deployments d
join portals p on p.id = d.site_id
join projects w on w.id = p.project_id
join organizations o on o.id = w.organization_id
where d.state = 'held' order by d.created_at;
-- Release one: the build live at its path, if any, is replaced by it
begin;
update site_deployments set state = 'replaced'
where state = 'live' and (site_id, path) = (select site_id, path from site_deployments where id = '{id}' and state = 'held');
update site_deployments set state = 'live', error = null where id = '{id}' and state = 'held';
commit;
-- Refuse one: its files go with the next sweep
update site_deployments set state = 'failed', error = 'Refused in review: {why}' where id = '{id}' and state = 'held';

For a build that is plainly abuse, suspend the organization as well.

Assets and tokens on /c/ already follow a new release without a build. Text a build bakes in doesn’t: give the site a deploy hook, the URL Vercel, Netlify, Cloudflare Pages or your CI gives you to start a build, and the brand it follows. Each release of that brand POSTs to it:

{ "event": "brand.released", "brand": "acme", "release": 12, "note": "Bluer primary", "site": "acme-docs" }

A release that changes nothing a site’s live builds read calls no hook: when every build deployed here names its release and rules in its manifest, and no rule they read changed since that release, the site’s panel says skipped: nothing it uses changed since release 11 and no build minutes are spent. A build that doesn’t say is built again for every release. The starters name *: their tokens.css carries every rule, so only releases that change pages or the theme alone pass them by.

Set it in the site’s panel in Sites (Rebuild on release), or on the API:

Terminal window
curl -X PATCH "https://app.example.com/api/v1/sites/{id}" \
-H "Authorization: Bearer $ARTBUCKET_KEY" -H "Content-Type: application/json" \
-d '{"rebuild": {"url": "https://api.vercel.com/v1/integrations/deploy/...", "brand": "acme"}}'

The URL is kept sealed and never shown again, only its host, with when a release last called it and what it answered. A site hosted elsewhere with a hook is in the brand’s lineage too, so replacing a logo shows it. null removes it.

The same hook builds the site again by hand: Rebuild on its row in Fixes, when a build still names an older component, or POST /api/v1/sites/{id}/rebuild, which calls it with {"event": "site.rebuild", "site": "{address}"}.

A build checked once can go wrong later: a photo’s license ends, a logo is replaced. Live builds are checked again about once a day, the same way. What may no longer be shown is listed on the deployment, in Sites and as problems in the API, and the site’s admins get an email when there is something new. The build stays live: deploy one without it, or restore one that has none.