SnabbSajt · Hjälp
För dig som äger hemsidanFör utvecklare
Site Kit SDK

Quickstart

Create, validate, pack, and import your first SnabbSajt site package.

Install

Until the npm registry release is verified, install the GitHub release candidate:

npm install github:HH-Studio/Sajtbuilder-SDK#main

Create a package

npx site-kit init ./my-site --template nextjs

Use --template html for a static HTML source. Both produce the same structured SnabbSajt format.

The generated directory contains:

my-site/
  site.json
  assets/
  fonts/
  README.md

Replace the starter business facts, page list, sections, and copy with real content from the source site. Do not invent facts or testimonials.

Validate

npx site-kit validate ./my-site

Errors block packing. Warnings describe safe importer coercions or suspicious content that deserves review.

Pack

npx site-kit pack ./my-site -o my-site.zip

The zip contains site.json, manifest.json, and every declared image/font. The manifest records a SHA-256 checksum for each blob.

Import

Send the site owner to /dashboard/import ("Läs in ett hemsidepaket" / "Load a website package") and have them drop the zip on it. That page works on a brand-new account with no sites yet, so it is the one link to hand a client.

The same picker also lives in Settings › Importera (Import), under "Läs in en kopia eller ett paket"Välj en fil från din dator.

Either way the result is a new draft website — nothing is published, and no existing site is touched. Review every page on desktop and mobile before publishing.

Update an already-imported site

Set a stable externalKey on every page and section from the start. Later you can pack the package again and merge it into the existing site instead of creating a new one: matched sections update, new keys insert, sections the owner edited in the app are skipped as conflicts, and nothing is deleted. You pack the whole package either way — the merge works out what changed from the keys. See the import report for the merge outcomes.

This works in the browser and over MCP. On /dashboard/import the owner chooses Update a website I already have and confirms a preview of the merge; the import_site MCP tool does the same headlessly with mergeIntoWebsiteId and needs only the content:write scope.

No API key is required for any Site Kit command.

The recommended one-line agent setup:

npx @snabbsajt/cli@0.2.0 skills install --agent auto

Hittade du inte svaret, eller stämmer något inte? Berätta det för oss.

Senast uppdaterad

På denna sida