Snabbsite · Docs
For developers

The starter kit

Clone templates/starter-smb, point it at a published Snabbsite website, and hand the client an editor they cannot break.

The starter kit is a small Next.js website that renders a Snabbsite site with your own code. You clone it, deploy it to your own host, and the client keeps editing text and pictures in Snabbsite. Publishing rebuilds your deployment.

It is where you start a new site in code. To bring an existing site across instead, read Convert a site with an agent.

Where it lives

The template is templates/starter-smb in the SDK repository, not in this documentation site. There is no copy of it here to download.

git clone https://github.com/HH-Studio/Sajtbuilder-SDK.git
cp -R Sajtbuilder-SDK/templates/starter-smb ./my-client-site
cd ./my-client-site
npm install
npm run dev

@snabbsajt/site-kit and @snabbsajt/cli are not published on npm yet. npm install above resolves them only when you install from the SDK repository's own workspace. Until the packages ship, treat the template as source you read and adapt rather than a dependency you install.

The environment variables it reads

With none of these set, the template renders its own src/site.ts fallback, so npm run dev works before you have a website to point at. That fallback looks plausible, which is exactly why the first thing to check after a deploy is that you are seeing the client's real content and not it.

VariableRequiredWhat it is
SNABBSAJT_API_URLYes, in productionThe delivery host, https://<deployment>.convex.site. Snabbsite gives you this value.
SNABBSAJT_SITE_IDYes, in productionThe id of the website whose published snapshot you render.
SNABBSAJT_DELIVERY_TOKENYes, in productionA read-only key for that one website. Starts with sajt_pub_. Shown once.
SNABBSAJT_DELIVERY_TOKEN (preview)OptionalA separate key starting with sajt_draft_, set only on your preview deployment. It reads the unpublished draft, so your preview shows work nobody has published.

Every one of these is server-only. Never put a key behind a NEXT_PUBLIC_ name and never ship one in a browser bundle. Create and revoke keys under Settings → Utvecklare → Nycklar för er app.

The mapping from the snapshot to components is renderModelFromPublished and renderModelFromPackage in @snabbsajt/site-kit, so your own app can use it without the template. Full detail: Headless delivery.

Rebuild when the client publishes

Create a deploy hook on your host and paste it into Settings → Utvecklare → Var hemsidan visas. Snabbsite calls it after a successful publish, so the client presses Publicera and your deployment rebuilds itself.

A second hook under Bygg om testversionen does the same for the draft, and it is heavily debounced so a burst of typing becomes one rebuild.

What the client may edit

The client edits content, never code. They can change:

  • text in any slot you marked editable, including headings and buttons;
  • pictures, and the alt text that goes with them;
  • contact details, opening hours and services;
  • the order of blocks on a page, and which pages exist;
  • when it goes live, through Publicera.

They cannot change your components, your styling, your routes, or anything that would break the build. If they edit a heading and you later send a new version, their heading is kept and the change is reported to you as a conflict rather than being overwritten.

Before you hand it over

  1. Deploy the template with the three variables set and confirm the page shows the client's published content, not the src/site.ts fallback.
  2. Paste the deploy hook and publish once from the editor. Confirm the rebuild fires without anyone touching your host.
  3. Invite the client and decide what they may use: Hand off to the client.

Didn't find the answer, or is something wrong here? Tell us.

On this page