Marketing site that needs a quote widget without touching your build pipeline. Paste the snippet, configure via data-attributes, done.
1<!-- TradeOS hosted flow -->2<script3 src="https://cdn.tradeos.app/v1/flow.js"4 data-tenant="mph-heating"5 data-vertical="boilers"6 data-theme="auto"7 data-position="bottom-right"8 defer9></script>1011<!-- optional: mount target -->12<div id="tradeos-root"></div>React or Next.js app where you want the full quote experience as a first-class component. Bring your own layout, TradeOS handles state, validation, and submission.
1import { QuoteFlow, QuoteProvider } from "@tradeos/react"2import { BoilerSchema } from "@tradeos/verticals/boilers"34export default function QuotePage() {5 return (6 <QuoteProvider7 tenant="mph-heating"8 vertical={BoilerSchema}9 onComplete={(quote) => router.push(`/confirm/${quote.id}`)}10 >11 <QuoteFlow12 showProgress13 theme="dark"14 className="my-flow"15 />16 </QuoteProvider>17 )18}You want total control over the UI but still want TradeOS to handle validation, pricing, AI, and submission. Build your own form, wire our hooks.
1import { useQuote, useField, useAI } from "@tradeos/react"23function CustomForm() {4 const quote = useQuote({5 tenant: "mph-heating",6 vertical: "boilers",7 })89 const postcode = useField(quote, "postcode")10 const fuelType = useField(quote, "fuelType")11 const ai = useAI(quote)1213 return (14 <form onSubmit={quote.submit}>15 <input {...postcode.inputProps} />16 {postcode.error && <span>{postcode.error}</span>}17 <select {...fuelType.inputProps}>18 {fuelType.options.map(o => <option key={o.value}>{o.label}</option>)19 </select>20 <button type="submit" disabled={!quote.isValid}>Get quote</button>21 </form>22 )23}You are building a backend integration, a custom pricing engine, or a non-JS client. Import the raw Effect Schemas and branded types directly.
1import { Schema } from "effect"2import { BoilerQuoteForm, UKPostcode, Pence } from "@tradeos/schema/boilers"34// Decode and validate raw input5const decode = Schema.decodeSync(BoilerQuoteForm)67const form = decode({8 postcode: "AB10 1XG",9 fuelType: "gas",10 bedrooms: 3,11 currentBoiler: "combi",12 desiredBoiler: "combi",13 urgency: "within-month",14})1516// Use branded types for type safety17const price: Pence = Pence(349900) // £3,499.0018const postcode: UKPostcode = UKPostcode("AB10 1XG")