Declare the Form
Add the Form tocapabilities.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
-
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". -
In your script, stop the browser’s own submit and send the values with
liteshop.forms.submit:
- Pass the Form ID as a literal string, such as
"contact". Every declared Form needs a matching call. - Don’t add
method="post"or anactionto the form. Liteshop doesn’t accept forms posted to the server. - Load the SDK before the script that calls it.
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:
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.