Skip to main content

Quick Start: Build Your First Plugin

Time: ~15 minutes | Difficulty: Beginner

What 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.
┌─────────────────────────────────────────────────┐
│  You build a page (React, Vanilla JS, anything) │
│                      ↓                          │
│  TagadaPay hosts it on its global edge CDN      │
│                      ↓                          │
│  The Plugin SDK connects your page to:          │
│    • Sessions & authentication                  │
│    • Checkout data (products, prices, cart)      │
│    • Funnel navigation (checkout → thank you)   │
│    • A/B testing, analytics, custom domains      │
└─────────────────────────────────────────────────┘
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:
  1. Checkout page — displays a payment form, collects user info, processes payment
  2. Thank you page — shows order confirmation with data from the checkout step
The SDK handles session creation, data passing between pages, and automatic redirects.

Prerequisites

You need three things before starting:
RequirementHow to get it
Node.js 18+nodejs.org — run node --version to check
TagadaPay accountSign up at app.tagadapay.com and create a store
API keyDashboard → 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.

Build & Deploy

Once your plugin works locally, deploy it to TagadaPay so it runs on the global edge CDN.
1

Build for production

npm run build
This creates a dist/ folder with your compiled HTML, JS, and CSS.
2

Deploy with the CLI

npm install -g @tagadapay/plugin-cli

tgdcli login
tgdcli deploy
The CLI reads your plugin.manifest.json, zips your dist/ folder, and uploads everything to TagadaPay. Follow the prompts to select your store.
3

Use it in a funnel

  1. Go to Funnels in your TagadaPay dashboard
  2. Create a new funnel (or edit an existing one)
  3. Add a Checkout step → select your plugin → pick the /checkout page
  4. Add a Thank You step → select your plugin → pick /thankyou/:orderId
  5. Save and test your funnel
You can also deploy via the REST API or upload a ZIP from the dashboard. The CLI is just the fastest option.

What the SDK Handles for You

You don’t need to write code for any of this — the SDK does it automatically:
FeatureWhat happens
SessionAn anonymous session is created on first visit and persisted across page loads
Funnel initThe funnel context (current step, data from previous steps) is loaded automatically
RedirectsAfter funnel.next(), the browser redirects to the next step URL
Debug modeEnabled automatically on localhost — uses mock data so you can develop offline
Config injectionwindow.__TAGADA_PLUGIN_CONFIG__ is injected with your instance config at runtime

Common Issues

Your app is not wrapped with <TagadaProvider>. Make sure main.tsx looks like:
<TagadaProvider>
  <App />
</TagadaProvider>
Make sure you pass data inside the resources key:
await funnel.next({
  data: {
    resources: {     // ← must be inside "resources"
      order: { ... },
      customer: { ... }
    }
  }
});
On the next page, access it via funnel.context?.resources?.order.
  1. Check the console for errors after funnel.next() resolves
  2. Make sure the funnel has a next step configured in the dashboard
  3. In local dev, the SDK may not redirect if there’s no real funnel — this is expected
const result = await funnel.next({ ... });
console.log('Navigation result:', result);
Make sure you import from the correct path:
// React hooks
import { useFunnel } from '@tagadapay/plugin-sdk/v2';

// Standalone (vanilla JS)
import { createTagadaClient } from '@tagadapay/plugin-sdk/v2/standalone';

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