Site Kit SDK
Convert Next.js, HTML, or WordPress evidence into a safe, editable SnabbSajt site package.
Site Kit is the open-source toolkit for developers and coding agents that need to bring an externally built website into SnabbSajt.
It does not execute Next.js, React, HTML, CSS, or JavaScript inside SnabbSajt. You map the finished site's content and structure to SnabbSajt's typed sections, validate the result locally, and pack it into the same self-contained bundle used by the product's backup importer.
What you get
- A typed
defineSite()authoring helper for TypeScript. - HTML URL/file/zip and WordPress URL+WXR conversion commands.
init,validate,inspect, review, approval, andpackcommands.- The production package validator and import caps.
- The public section registry, variants, theme types, and package types.
- Checksum-protected image and font bundles.
- Versioned agent skills for Codex and Claude Code.
What stays safe
By default the import creates a new unpublished draft. It never publishes a site. The SnabbSajt server validates the package and asset bytes again before storing anything. Raw HTML, scripts, iframes, custom CSS, and foreign database ids are not accepted.
Incremental merge import
Packages can also be merged into an existing site instead of creating a
new one. Give every page and section a stable externalKey, pack the package
as normal, and import as a merge: new keys insert, untouched sections update,
owner-edited sections are skipped as conflicts, and nothing is ever deleted.
The merge decides what changes by matching keys, so there is nothing to select
at pack time. A restore point is taken automatically before the merge. See the CLI reference and
import report for details.
Merge is not in the browser UI yet. The browser importer always creates a
new draft site. Merging a partial bundle into an existing site runs through the
MCP import_site tool (see below) or the site-kit script. A browser flow for
it is planned.
Authentication
Site Kit is local and keyless. You do not need an API key to author, validate, inspect, or pack a site.
Importing the zip (no key needed). A signed-in SnabbSajt user opens /dashboard/import — labelled "Läs in ett hemsidepaket" / "Load a website package" — and chooses the file. That page works even on a brand-new account with no sites yet, so it is the link to hand a client. The same file picker also sits in Settings › Importera (Import) under "Läs in en kopia eller ett paket".
Importing over MCP (agents). The import_site MCP tool does the same thing
without a browser. It requires the content:write scope — and nothing else: the
advanced-editor capability was dropped (owner ruling 2026-07-25) because the
browser importer is the proof that turning a package into a draft site is not a
privileged act. The limits that do apply are the connection's scope, the
per-workspace import rate limit and the per-plan site cap. Merging into an
existing site works from both the tool and the browser.
Start with the quickstart, then choose the Next.js, HTML, or WordPress workflow.
Site Kit 0.2 is published on npm as
@snabbsajt/cli@0.2.0. It is a beta: expect the package format to stay stable, the browser surfaces to keep moving. Automatic pixel-perfect code conversion is not part of the SDK.
Hittade du inte svaret, eller stämmer något inte? Berätta det för oss.
Senast uppdaterad