Skip to main content

Tagada Rx with the Plugin SDK

The Plugin SDK is the fastest way to ship an Rx storefront: your React app is deployed on Tagada infrastructure (custom domain, instant swap, A/B testing) and gets checkout, payments, and session plumbing for free. The reference implementation is the TGD Care template — live at tgdcare.com. Two mono-vertical archetypes are also available: Cobalt (plan-first, cobalt.tgdcare.com) and Arbor (quiz-first, arbor.tgdcare.com) — see Storefront templates for the full catalog and how each maps onto the shared funnel skeleton. oakwell.tgdcare.com is a parked reskin until it is remounted.
Why Plugin SDK for Rx? Multi-instance deploys (one plugin, many affiliate subdomains), integrated funnel engine, and the apiService that already knows the environment’s API base URL and the customer’s CMS session — which the patient portal needs. If you’re integrating Rx into an existing external site instead, use the Headless SDK.

The pattern

The plugin SDK doesn’t ship an rx namespace — you wrap its apiService with two tiny clients (copy them from the Oakwell template):
  • createRxClient calls the public endpoints with skipAuth: true — they authorize per-resource via (orderId, checkoutToken).
  • createPortalClient calls the portal endpoints with normal auth — the SDK automatically attaches the customer’s x-cms-token once they’ve logged in via the OTP flow (useLogin).

1. Gate the product behind the quiz

2. Authorize at checkout, submit the case on thank-you

Payment is standard Plugin SDK (useCheckout, usePayment) with mode: 'auth'. That places a hold — it does not capture. On success, park identity in sessionStorage and send the patient to /thank-you to complete the network questionnaire, then submitCase. Approve later captures the hold; decline voids it.
Multiselect answers: join them into one comma-separated string before submitting ({ questionId: 'goals', value: 'lose_weight,improve_sleep' }). The networks only accept string/number/boolean values.

3. Live status on the thank-you page

4. The patient portal

Oakwell ships a complete portal page (/portal) you can lift as-is:
Features you get by copying the template page: treatments list, case timeline, secure message thread with file attachments, and photo-ID upload for requiresIdVerification offerings. See Patient portal for the API contract.

Starting from the Oakwell template

The fastest path is to fork the template rather than build from scratch:
Key config knobs in default.config.json:
Deploy with the standard plugin pipeline (plugins/v2 build → deploy → swap onto your domain). In affiliate mode, each affiliate brand is one plugin instance on its own marketplace subdomain — same code, different config.