Before you begin
- Install Node.js 22 or later.
- Sign in to the Liteshop dashboard.
Create the app
sveltekit-adapter add-on installs @sveltejs/adapter-static and sets it as the adapter in vite.config.ts.
Prerender every page by adding src/routes/+layout.ts:
Add the manifest
SvelteKit copies everything instatic/ to the root of the build, so put liteshop.json there:
capabilities as {} if the Site has no Form. The Site Bundle reference lists every field.
Add the SDK
Install the Liteshop SDK:liteshop from it wherever the Site uses Forms, bookings or the catalogue. It calls the Site’s own Liteshop endpoints and includes its TypeScript types.
To try Forms with npm run dev, add the Liteshop plugin to vite.config.ts:
sveltekit({ ... }). On the dev server, the plugin answers the SDK from liteshop.json: Form submissions are checked and printed in the terminal, the catalogue lists every item as available, and nothing is saved or sent to Liteshop. The plugin reads static/liteshop.json.
Submit a Form
Import the SDK and pass the Form ID as a literal string. Liteshop readsliteshop.forms.submit("contact", ...) from your built JavaScript to check that every declared Form has a handler. Put the Form in src/lib/Contact.svelte:
src/routes/+page.svelte:
onsubmit with JavaScript, not as an HTML attribute, so it works under the Site’s security policy. Don’t add method="post" or an action to the form, and don’t use SvelteKit form actions. See the Forms reference for field types and the anti-spam field.
Build and package the Site
index.html and liteshop.json at its root, which zipping the contents of build gives you.
Upload the Site
To publish a new Site:- In the Liteshop dashboard, click Website > Upload files.
- Enter the Site name and subdomain, and select
site.zip. - Click Check and publish.
liteshop.json must name the live version in baseDeployment. If the value is missing or out of date, validation fails, and its repair message gives the exact value to set in static/liteshop.json. For details, see Publish and manage a Site.
Routing
Liteshop serves/about from about.html, and from about/index.html by redirecting to /about/. With SvelteKit’s default trailingSlash setting, a route such as src/routes/about/+page.svelte is prerendered to about.html, so keep that default and link to /about without a trailing slash.
Prerender every page, and avoid routes with parameters that the build can’t discover by following links. Prerendered pages load faster and work for search engines.
What runs on Liteshop
Liteshop hosts static output only: no server rendering,+page.server.ts or +server.ts files, form actions or remote functions. The Site’s security policy blocks scripts, styles and network requests to other origins, frames, workers and eval. Validation warns when your build appears to use one of those features, and fails on external scripts and frames. SvelteKit’s runtime mentions fetch and service workers, so every SvelteKit build gets those warnings; you can ignore them when your own code doesn’t use either.
Dashboard edits
Site Owners can edit catalogue items, collections, and stock in the dashboard, which publishes a new Deployment from your files without rebuilding your app. Read the catalogue in the browser withliteshop.catalogue.list(). Don’t import liteshop.json or render catalogue items at build time; otherwise, dashboard edits don’t appear on the Site until you rebuild and upload it again. See the Catalogue reference.