Instrument bespoke forms and SPAs without building APIs
Instrument React, Vue, Svelte, or vanilla JS forms with a single SDK that captures submissions, context, and attribution while letting you keep custom logic and styling.
Platform category: Developer
Why teams use LeadToSheet for Custom HTML & JavaScript
LeadToSheet exposes a lightweight event emitter you can call manually if you prefer direct control. It also auto-binds to native form submits, providing a frictionless path to pipe submissions into Google Sheets for prototypes, hackathons, or production apps.
Auto-detect forms
Listens for submit events on dynamically inserted forms with MutationObserver support.
Manual capture API
Call `window.leadtosheet.capture()` with custom payloads for multi-step or app-based flows.
TypeScript typings
Ship confidence with the included SDK typings for strict builds.
Setup checklist
- 1
Load the SDK
Paste the snippet into your app shell or import the npm package when using module bundlers.
Script embed
<script src="https://cdn.leadtosheet.com/sdk.min.js" data-client="YOUR_CLIENT_KEY"></script>
- 2
Optionally emit manually
Call `window.leadtosheet.capture({ fields: { email, plan }, context: { path: window.location.pathname } })` inside your custom submission handler.
Tip: When you let LeadToSheet handle the submit event automatically, no additional code is required.
- 3
Monitor sheet delivery
Use the dashboard activity log to confirm submissions arrive with metadata and retry logic for resiliency.
Snippet
Manual capture example
Use the capture helper for frameworks that bypass native form submits.
window.leadtosheet.capture({
form: 'onboarding-demo',
fields: {
email: 'demo@example.com',
teamSize: '5-10',
goal: 'Pipe demo requests into CRM',
},
context: {
path: window.location.pathname,
},
})
Single-page apps
Capture modal and in-app forms without hitting your backend first.
Chatbot lead forms
Send conversational flow outputs to Sheets for routing and analytics.
Mobile web experiences
Integrate progressive web apps without writing new API routes.
Frequently asked questions
- Is there an npm package?
- Yes. Install `npm install @leadtosheet/sdk` and initialise it with your client key for bundler-based apps.
- How do retries work?
- Failed submissions queue locally and retry with exponential backoff until your visitors regain connectivity.
- Can I self-host the SDK?
- Contact support for access to the npm bundle if you prefer to serve the script from your infrastructure.