Skip to main content
A Form lets Visitors send a message to the Site Owner. Each submission appears in the Messages page of the dashboard. Visitors can’t read submissions, and the Site’s code never receives the Owner’s credentials.

Declare the Form

Add the Form to capabilities.forms in liteshop.json:
Keep Form and field IDs unchanged after the Site receives messages. A Deployment can’t remove an ID that stored messages refer to.

Submit the Form

  1. Load the SDK on the page, before your script. A Site built with a framework imports it instead, with import { liteshop } from "@liteshop.ai/sdk".
  2. In your script, stop the browser’s own submit and send the values with liteshop.forms.submit:
Follow these rules, which validation checks:
  • Pass the Form ID as a literal string, such as "contact". Every declared Form needs a matching call.
  • Don’t add method="post" or an action to the form. Liteshop doesn’t accept forms posted to the server.
  • Load the SDK before the script that calls it.
Liteshop checks types strictly and doesn’t convert strings. Convert number inputs to numbers and checkbox inputs to booleans before you send them.

Protect the Form from spam

The _liteshop_honeypot input catches automated form fillers. Hide it with CSS rather than type="hidden", so that bots still fill it in:
The SDK removes the honeypot from the values and doesn’t store it. Liteshop also limits each Visitor to five submissions per Form every 10 minutes, and each Site to 100 submissions every hour. Above the limit, the SDK rejects with RATE_LIMITED.

Language and retries

The SDK sends the page language from <html lang>. Liteshop uses it if the Site declares that language, and otherwise uses the Site’s default language. Each submission has an identifier, and the SDK retries one network failure with the same identifier, so a retry never creates a duplicate message.

Manage messages

In the dashboard, the Messages page lists submissions. The Owner can mark them as read or unread, correct them, and delete them.
Previews can’t send forms. To test a submission, publish the Site and use its live address, or use the local dev plugin.