Deprecated APIs
These APIs have replacements and should not be used in new code. Existing usages should be migrated when touching the relevant files.Plugin SDK (@tagadapay/plugin-sdk)
Node SDK (@tagadapay/node-sdk)
CRM App
Studio App
Must-Know Architecture Patterns
These are non-obvious patterns that every developer touching the codebase must understand.CRM App
The CRM is a Vite SPA with React Router — not Next.js. Server-side API and tRPC routers live on the main Tagada app at
/api/crm/trpc, not inside crm-app.- Clerk provides auth. JWT is passed as
Authorization: Bearerto tRPC. - Org context is synced via
OrgRouteWrapper— when the user switches org,useResetQueries()invalidates all queries to avoid stale data from the previous org.
- Funnels have both
nodes/edges(V2 graph model) and legacysteps(flat list), kept in sync viauseFunnelData. - Always deep-copy nodes/edges before mutating — they come from React Query cache.
- Never copy
urlwhen cloning steps — the backend recomputes URLs from mount points. - Split-test variants each have their own
stepConfig.
instantiatecreates a plugin instance but does NOT mount it to a funnel step.- The user must explicitly configure and publish. Code should not assume instantiation = live.
Studio App
Two operating modes:- Embedded (inside CRM iframe): communicates via Builder Protocol (
postMessage), skips localStorage hydration to avoid stale data. - Standalone (direct URL): authenticated via Clerk, full localStorage persistence for work-in-progress recovery.
- Vanilla Zustand store (works outside React for island hydration).
- MockResolver provides static fixtures for design mode. TagadaResolver makes real API calls in live mode.
- Use
registerAction(type, handler)to register action handlers. The oldsetActionHandlercatch-all is deprecated.
The modes
interactive, esbuild-bundle, and esbuild are legacy and should not be used.
Template parsing:
parseTemplateFile()accepts 3 formats for backward compatibility:StudioTemplateFilewrapper, legacy{ version, template }, and rawFunnelTemplate.- Legacy page types
upsell/downsellauto-normalize tooffer.
