Quick Start: Build Your First Plugin
Time: ~15 minutes | Difficulty: BeginnerWhat Is a Plugin?
A plugin is a web page (HTML/CSS/JS) that runs on TagadaPay’s hosting infrastructure. Unlike a regular website, a plugin is connected to TagadaPay’s backend — it gets automatic session management, funnel navigation, checkout data, and analytics.Plugin SDK = your bridge to TagadaPay. Without it, your page is just static HTML on a CDN (which is fine — see the Hosting & A/B Test guide). With the SDK, your page becomes a fully integrated checkout experience with session tracking, payments, multi-step funnels, and more.
What You’ll Build
A two-page checkout plugin:- Checkout page — displays a payment form, collects user info, processes payment
- Thank you page — shows order confirmation with data from the checkout step
Prerequisites
You need three things before starting:| Requirement | How to get it |
|---|---|
| Node.js 18+ | nodejs.org — run node --version to check |
| TagadaPay account | Sign up at app.tagadapay.com and create a store |
| API key | Dashboard → Settings → API Keys → generate one |
Choose Your Framework
Pick the tab that matches how you want to build. Both produce the same result — a deployable plugin.- React (Recommended)
- Vanilla JavaScript
Best for rich, interactive UIs. Uses React hooks to access checkout data, funnel state, and more.
Key concept: Notice how In local development, the SDK automatically enables debug mode — it creates a mock session and loads test data so you can develop without a live TagadaPay backend.
1. Create the project
wouter is a lightweight router (3 KB) — the same one TagadaPay’s own checkout template uses.2. Create the plugin manifest
The manifest tells TagadaPay what pages your plugin has and what data each page needs. Createplugin.manifest.json in your project root:What do these fields mean?
What do these fields mean?
| Field | Purpose |
|---|---|
mode: "direct-mode" | The plugin renders as a full page (not inside an iframe) |
pages | Each entry is a URL your plugin handles |
features.type | What kind of page it is — checkout, thankyou, offer, etc. |
requirements | What data the page needs (checkout session, order, etc.) |
remappable: true | Allows merchants to customize the URL path in their funnel |
router.matcher | Which URLs this plugin should handle (.* = all) |
3. Wrap your app with TagadaProvider
Replace the contents ofsrc/main.tsx:TagadaProvider is the single entry point for the SDK. By wrapping your app, you get:- Automatic session creation
- Funnel initialization (no setup code needed)
- Access to all hooks (
useFunnel,useCheckout,useCurrency, etc.) - Auto-redirect after
funnel.next()
4. Build the checkout page
Createsrc/pages/CheckoutPage.tsx:funnel.next() sends data to the next step and auto-redirects the browser. The resources you pass (order, customer, payment) become available on the next page via funnel.context.resources.5. Build the thank you page
Createsrc/pages/ThankYouPage.tsx:order and customer come from funnel.context.resources — exactly what was passed in funnel.next() on the checkout page. The SDK handles the data transfer automatically.6. Set up routing
Replacesrc/App.tsx:7. Test locally
Build & Deploy
Once your plugin works locally, deploy it to TagadaPay so it runs on the global edge CDN.Deploy with the CLI
plugin.manifest.json, zips your dist/ folder, and uploads everything to TagadaPay. Follow the prompts to select your store.Use it in a funnel
- Go to Funnels in your TagadaPay dashboard
- Create a new funnel (or edit an existing one)
- Add a Checkout step → select your plugin → pick the
/checkoutpage - Add a Thank You step → select your plugin → pick
/thankyou/:orderId - Save and test your funnel
What the SDK Handles for You
You don’t need to write code for any of this — the SDK does it automatically:| Feature | What happens |
|---|---|
| Session | An anonymous session is created on first visit and persisted across page loads |
| Funnel init | The funnel context (current step, data from previous steps) is loaded automatically |
| Redirects | After funnel.next(), the browser redirects to the next step URL |
| Debug mode | Enabled automatically on localhost — uses mock data so you can develop offline |
| Config injection | window.__TAGADA_PLUGIN_CONFIG__ is injected with your instance config at runtime |
Common Issues
useFunnel() returns undefined
useFunnel() returns undefined
Your app is not wrapped with
<TagadaProvider>. Make sure main.tsx looks like:Data is empty on the thank you page
Data is empty on the thank you page
Make sure you pass data inside the On the next page, access it via
resources key:funnel.context?.resources?.order.Redirect not working after funnel.next()
Redirect not working after funnel.next()
- Check the console for errors after
funnel.next()resolves - Make sure the funnel has a next step configured in the dashboard
- In local dev, the SDK may not redirect if there’s no real funnel — this is expected
TypeScript: cannot find module '@tagadapay/plugin-sdk/v2'
TypeScript: cannot find module '@tagadapay/plugin-sdk/v2'
Make sure you import from the correct path:
Next Steps
Build a Multi-Step Funnel
Add an upsell page between checkout and thank you, learn static resources
Plugin Manifest Guide
Deep dive into pages, features, requirements, and configuration presets
Funnel Resources
Pass complex data (orders, customers, offers) between steps
API Reference
All available hooks and methods
Host Without SDK
Deploy static HTML and run A/B tests without the SDK
CLI Reference
Automate deploys with the command-line tool
