Tagada Rx with the Headless SDK
Running your storefront on your own hosting (Vercel, Netlify, Shopify headless, an AI-generated site)? The Headless SDK ships a first-classtagada.rx module that mirrors the public storefront endpoints — no API key in the browser, ever.
Auth model: there is no key.
isRequiredForProduct is public; the case routes prove ownership with the (orderId, checkoutToken) pair your checkout flow already holds. PHI transits to the clinical network and is never persisted by Tagada.The calls
1. Is this an Rx product?
2. Check the patient before payment
The clinical network only accepts US patients: an address in one of the 50 states or DC, a US phone number, a 5 digit ZIP, an adult. Check it before taking the payment, so a card is never held for a patient who cannot be treated:3. Show the network questionnaire, then submit
Run your normal headless checkout (tagada.checkout + tagada.payment). Once the order is paid, render the
questionnaire written by the clinical network as is: it includes the questions the clinician needs on the
patient profile (height, weight, allergies, medications, conditions, pregnancy). Two helpers make it plug and play:
isQuestionActive(question, answers, { state, sexAtBirth })tells you which questions to show right now (hidden clinician questions never, “Drug Allergies” only after “Yes”, pregnancy only for women, state rules).toIntakeAnswers(questions, answers, context)builds theintakeAnswersto send.
The server enforces these rules on every submit, whatever the integration. A patient or intake that does not
meet them fails with 422 and the list of fields to fix; nothing reaches the clinician and the same order
can be resubmitted.
validateIntake with intakeAnswers returns the same list before you submit.
Never replace the network questionnaire with your own quiz: an empty questions list means the product has none.4. Poll status on the thank-you page
Before checkout: are Rx payments ready?
payments is 'ready' once the brand’s Rx payment account is live and its
payment flow is bound. It is a status, not a step: the brand has nothing to do
while it reads 'setting_up'. An Rx checkout attempted before that is refused
server-side with “Payments for this treatment are being set up”. This public
call leaves out payout verification and partner contract items; the Node SDK
rx.activationStatus() returns them.
Available since @tagadapay/headless-sdk 1.16.0.
Full example: React thank-you page
Install the same Funnel v2 (CRM canvas)
A headless build still needs the six-step Funnel v2 so operators see landing, quiz, checkout, offer, thank-you, and portal in the CRM. Create it with the Node SDK (API key, server-side) — the browser SDK only runs the bricks. Working example:rx-storefront/
in tagada-examples. pnpm seed
calls tagada.funnels.create with this graph; you can also import
funnel.bundle.json
from Funnels → Import bundle.
/thank-you after payment (getQuestionsForProduct → submitCase →
poll). The marketing quiz on /quiz has no medical questions.
