Astro Integration
Handle FormSync submissions inside your Astro application.
Install the Package
Install FormSync using your preferred package manager:
Terminal
You can also use npm, yarn, or bun.
Usage with Astro
FormSync provides a helper function handleFormSubmit designed for Astro's server-side logic (e.g., handling forms in an .astro file or API endpoint).
Example
Astro Form Example
Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
formData | FormData | true | The FormData object from the request. |
config | object | true | An object containing formId and baseURL. |
Note:
onSuccessandonErrorcallbacks are not applicable here since this runs on the server. You can handle the response directly in your logic.
How is this guide?
Last updated on April 24, 2026