Skip to content
formgongPublic

About

Official JavaScript SDKs for Formgong: form backend for contact forms (email, Telegram, webhooks). Core, React, Next.js, Vue, Svelte, Astro, CLI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Formgong JavaScript SDKs

CI license core size

Official packages for Formgong, the form backend for contact forms. Your form posts to Formgong, and each submission arrives by email, Telegram or webhook. You don't need a server, a database or SMTP. There is a free plan, data is stored in the EU, and messages come in 12 languages.

npx formgong init        # create a form + add a contact page to your Next.js / React / Vue / Svelte / Astro / Angular / HTML project
Package Version Use it for
@formgong/core npm Any JS runtime: submit(), typed errors, anti-spam tracker, account API. About 3 kB, no dependencies, ESM + CJS.
@formgong/react npm <ContactForm>, <FormgongForm>, useFormgong() in React, Lovable, Bolt, v0 and Vite
@formgong/next npm Next.js Server Actions (useActionState), Route Handlers, App Router components
@formgong/vue npm Vue 3 and Nuxt components and the useFormgong() composable
@formgong/svelte npm use:formgong action, store helper and components for Svelte 4/5 and SvelteKit
@formgong/astro npm Astro components with progressive enhancement, plus a helper for Astro Actions
@formgong/angular npm Angular 17+ standalone component, formgongForm directive and FormgongService with signals
formgong npm CLI: login, init, forms, create, snippet, submissions
create-formgong npm npm create formgong@latest: Next.js, Astro, HTML and React starters

30-second examples

// React / Next.js / Lovable / Bolt
import { ContactForm } from "@formgong/react";
<ContactForm accessKey="fk_your_access_key" />
// Anywhere (Node, Workers, Deno, Bun, browser)
import { submit } from "@formgong/core";
await submit("fk_your_access_key", { email: "[email protected]", message: "Hi!" });
---
import ContactForm from "@formgong/astro/ContactForm.astro";
---
<ContactForm accessKey="fk_your_access_key" />
// Angular 17+ (standalone)
import { FormgongContactFormComponent } from "@formgong/angular";
@Component({ imports: [FormgongContactFormComponent], template: `<formgong-contact-form accessKey="fk_your_access_key" />` })

The access key (fk_…) is public by design: it can only send submissions to your form. Get one free at formgong.com.

What every package does for you

  • It adds the hidden access_key and _lang fields and a botcheck honeypot. Without JavaScript the form still posts natively.
  • It shows Formgong's localized success or error message in an aria-live region.
  • It sends the same cookie-free anti-spam signals as Formgong's fg.js: fill time, typing and paste counts, and a small SHA-256 proof-of-work. Server-side posts never fabricate them and are never penalised for lacking them.
  • Errors are typed, with stable codes (unknown_access_key, rate_limited, turnstile_missing, …).

Compared with other form backends

Formgong delivers to Telegram as well as email, stores data in the EU, works in 12 languages and has a free plan. See the side-by-side comparison with Formspree, Web3Forms, Basin, Getform, FormSubmit and Netlify Forms: formgong.com/en/compare. Coming from Formspree? Switch in one line.

Development

pnpm install
pnpm build && pnpm typecheck && pnpm test
  • packages/*: published packages (pnpm workspaces, tsup, vitest; @formgong/angular is built with ng-packagr in partial Ivy mode).
  • examples/next-server-action: Next.js Server Action example.
  • scripts/e2e.mjs: end-to-end check against a live Formgong deployment.
  • Releases: Changesets + a manual GitHub Actions workflow with npm provenance. See RELEASING.md. (Workflows live in .github/workflows-to-enable/ until they are moved into .github/workflows/.)

Docs: https://formgong.com/en/docs/ · MCP server: https://formgong.com/en/docs/mcp/ · Support: [email protected]

MIT © Formgong

About

Official JavaScript SDKs for Formgong: form backend for contact forms (email, Telegram, webhooks). Core, React, Next.js, Vue, Svelte, Astro, CLI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages