Skip to content

Projects

View as Markdown

A project is the top-level unit of organization in StoryShelf. The key mental model: one project = one Storybook, not one git repository.

A project wraps a single Storybook and its history of builds. It carries:

  • A name and a URL-safe slug used in all HTML/public URLs.
  • The git default branch (default main) that drives baseline fallback and auto-approval.
  • Diff thresholds (pixel_threshold, max_diff_ratio).
  • An optional git_repository ("owner/repo") link — many projects may share a repo.
  • An optional public_branch_regex for auth-free published Storybooks.

Because a project is one Storybook, a monorepo with several Storybooks creates several projects — each with its own slug, token, label types, and git channels. Each project’s git channel posts its commit status as <prefix>/testing; give the channels of projects that share a repository different prefixes so multiple Storybooks on the same revision don’t collide.

The quickest way is the CLI (requires site-admin token, writes .storybook/storyshelf.json):

Terminal window
npx storyshelf create --url http://localhost:3000 --name "My Design System" --token $STORYSHELF_ADMIN_TOKEN
# or initialize client config for an existing project:
npx storyshelf init --url http://localhost:3000 --slug my-design-system

This creates the project and returns its slug and a CI token (or just writes client config). You can also create and manage projects from the web UI’s project-create and settings pages.

Projects authenticate the CLI/CI with API tokens (Authorization: Bearer <token>). Tokens are per-project, so a CI token can only touch its own project. Create, list, and revoke tokens in project settings. Tokens are stored hashed; the raw value is shown once at creation.

When auth is enabled, projects track members and their project-scoped roles:

RoleCapabilities
viewerView builds, diffs, and published Storybooks
developerView + upload builds
approverView + approve/reject snapshots
adminFull control, including members and settings

Site-wide admin users bypass project roles. Manage membership from the project settings page.

Each project has settings for:

  • Members — project-scoped roles.
  • Label types — the typed labels (pr, mr, jira, etc.) and their link templates. See Labels.
  • Public access — the public_branch_regex controlling auth-free published Storybooks.
  • Tokens — CI API tokens.
  • Webhooks — notify external systems of build events.
The projects overview: a card per project with its latest build and review backlog The projects overview: a card per project with its latest build and review backlog

A project contains builds (one per upload, identified by ULID rather than git SHA so re-runs are possible) and baselines (per branch). Builds are transient and purged by retention; default-branch baselines are permanent, feature-branch baselines are GC’d after branchTtlDays (30d daily sweep). See Baselines & branches.