> ## Documentation Index
> Fetch the complete documentation index at: https://docs.liteshop.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Test a Site on your computer

> Run your Site on a local dev server and try Forms, bookings, and the catalogue without sending anything to Liteshop.

A local dev server doesn't have Liteshop's `/_liteshop/` endpoints, so SDK
calls fail there. The Liteshop Vite plugin answers those calls from your
`liteshop.json`, so you can try your Site before you publish it.

## Before you begin

* Install [Node.js](https://nodejs.org) 22 or later.
* Use [Vite](https://vite.dev), or a framework built on Vite, such as
  SvelteKit, Nuxt, or Astro. For other Node.js dev servers, see
  [Use another dev server](#use-another-dev-server).

## Add the plugin

1. Install the SDK package, which includes the plugin:

   ```sh theme={null}
   npm install @liteshop.ai/sdk
   ```

2. Add the plugin to your Vite configuration, for example `vite.config.ts`:

   ```ts theme={null}
   import { defineConfig } from "vite";
   import { liteshop } from "@liteshop.ai/sdk/vite";

   export default defineConfig({
     plugins: [liteshop()],
   });
   ```

   Keep any other plugins your project already lists.

3. Start the dev server, for example with `npm run dev`.

The plugin reads `liteshop.json` from Vite's public folder: `public/`, or
`static/` in SvelteKit. To use another path, pass it to the plugin:

```ts theme={null}
liteshop({ manifest: "path/to/liteshop.json" })
```

## Test a Site without a build step

For a Site without a build step, such as the
[HTML quickstart](https://docs.liteshop.me/develop/quickstart.md), run Vite from the folder that contains
the Site's folder, so that Vite's files don't end up in your ZIP file.

1. In the parent folder of `my-site`, install Vite and the SDK package:

   ```sh theme={null}
   npm install --save-dev vite @liteshop.ai/sdk
   ```

2. In the same parent folder, create `vite.config.js`:

   ```js theme={null}
   import { liteshop } from "@liteshop.ai/sdk/vite";

   export default {
     root: "my-site",
     publicDir: ".",
     plugins: [liteshop()],
   };
   ```

3. Run `npx vite` and open the address it prints.

## What the plugin does

* Checks Form submissions and booking and catalogue requests against
  `liteshop.json`, prints them in the dev server's terminal, and accepts them.
  Nothing is saved or sent to Liteshop.
* Returns the manifest's catalogue from `liteshop.catalogue.list()`, with every
  item available.
* Returns every date as available for nightly and daily Offers. Timed Offers
  return no slots.
* Serves `/_liteshop/sdk/v1.js` for pages that load the SDK with a script tag.

To test real submissions, publish the Site and use its live address.

## Use another dev server

For a Node.js dev server that accepts connect-style middleware, use
`liteshopDevMiddleware()` from the same module. It reads
`public/liteshop.json` unless you pass a `manifest` path:

```js theme={null}
import { liteshopDevMiddleware } from "@liteshop.ai/sdk/vite";

app.use(liteshopDevMiddleware());
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.