Skip to content

dutchcode/saleshose-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SalesHose — Developer Docs

Embed a SalesHose conversational lead-qualification form into any website with one line, and read its data over a public REST API.

SalesHose builds conversational, one-question-at-a-time forms that score, route, and book your leads. This repo is the public developer reference. Live, always-current docs: https://saleshose.com/docs.

  • 🔌 Embed: embed.js — inline, popup, or floating chat bubble
  • 🧩 Works in: WordPress, Shopify, HubSpot, Webflow, React, or plain HTML
  • 🔓 Public REST API (no key): get a form, submit a response, track events
  • 🤖 Machine-readable: llms.txt · openapi.json

Quickstart

Every form has a slug (e.g. demo). Drop these two lines where the form should appear:

<div data-saleshose="demo"></div>
<script src="https://saleshose.com/embed.js" async></script>

The form loads in a sandboxed <iframe>, so it never clashes with your site's CSS or JS. Replace demo with your form's slug (visible in the builder, or in the URL saleshose.com/f/your-slug).

Embed modes

Inline

<div data-saleshose="demo" data-height="600"></div>
<script src="https://saleshose.com/embed.js" async></script>

Popup button

<div data-saleshose="demo" data-mode="popup" data-label="Talk to sales"></div>
<script src="https://saleshose.com/embed.js" async></script>

Chat bubble (one line, any site)

<script src="https://saleshose.com/embed.js" data-saleshose="demo" data-mode="bubble" data-label="💬 Chat" async></script>
Attribute Where Values
data-saleshose div or script your form slug (required)
data-mode div or script inline (div default) · popup · bubble (script default)
data-label div or script button / bubble text
data-height div (inline) pixels, default 560

Platform guides

Platform How
WordPress Add a Custom HTML block and paste the snippet (Classic editor: Text tab).
Shopify Add a Custom Liquid section or an HTML block and paste the snippet.
HubSpot Drag an Embed / Rich text → Source code module and paste the snippet.
Webflow Drop an Embed element and paste the snippet.
Framer / Wix / Squarespace Use the platform's Embed / Custom Code block.
Plain HTML / any site Paste anywhere in your HTML.

React / Next.js

import { useEffect } from "react";

export default function SalesHoseForm({ slug }) {
  useEffect(() => {
    const s = document.createElement("script");
    s.src = "https://saleshose.com/embed.js";
    s.async = true;
    document.body.appendChild(s);
    return () => { s.remove(); };
  }, []);
  return <div data-saleshose={slug} />;
}

JavaScript API

SalesHose.open("demo");                                  // open in a modal
SalesHose.render({ slug: "demo", target: "#lead-form", mode: "inline" });
SalesHose.render({ slug: "demo", mode: "bubble", label: "Need a quote?" });
SalesHose.close();

On submit, the embed posts a message to the host page:

window.addEventListener("message", (e) => {
  if (e.data && e.data.type === "saleshose:submitted") {
    console.log("Lead captured for", e.data.slug, "score", e.data.score);
  }
});

Public REST API

No key required. Base URL https://saleshose.com.

Get a form's config

GET /api/forms/{slug}
200 → { "slug": "demo", "title": "…", "config": { "blocks": [...], "theme": {...} } }

Submit a response

Answers are keyed by each block's name. Returns the lead score and the resolved ending (including any round-robin–assigned rep and booking link).

POST /api/forms/{slug}/responses
Content-Type: application/json

{
  "data": { "name": "Jane", "email": "jane@acme.com", "budget": "€20k+" },
  "completed": true,
  "meta": { "utm_source": "google" }
}

200 → {
  "ok": true,
  "id": "…",
  "score": 105,
  "ending": { "title": "…", "book": { "url": "https://cal.com/rep/intro" }, "rep": "Alice" }
}

Partial capture: pass a stable "id" with "completed": false, then re-POST the same id with "completed": true to finish.

Track funnel events (optional)

POST /api/forms/{slug}/events
{ "kind": "view" | "start" | "complete", "session": "…" }

Build with AI

Point your AI coding tool (Cursor, v0, Lovable, Claude, Copilot…) at:

Or paste this prompt:

Add a SalesHose conversational lead form to my site.
Embed it with:
<div data-saleshose="MY_SLUG"></div>
<script src="https://saleshose.com/embed.js" async></script>
Modes: data-mode="inline|popup|bubble". JS API: SalesHose.open(slug),
SalesHose.render({slug,target,mode,label}). It loads in an iframe.
Full docs: https://saleshose.com/docs

SalesHose is a product by Dutchcode B.V. · Support: support@dutchcode.com

About

SalesHose developer docs — embed a conversational lead form in any site + public REST API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages