An open source library and set of SQL migrations that adds leads, sales activity, agents and lifetime partner commissions to your own Node app and your own Postgres. No separate server, worker or second login.
npx tandem-crm init --database-url "$DATABASE_URL" --sample-data
▲ Capture a lead. Route it to the right agent. Keep the sales trail. Hold and release commission. Resolve disputes with a record you can replay. Tandem gives your app the workflow primitives; you keep the decisions.
Tandem is a library, not a service. There is no separate server, worker, container or queue to deploy.
Camp mounts into your Next.js app as one route and runs on Node, like the rest of your app. It does not run on the edge runtime.
On serverless, use a pooled connection. Tandem needs a role it can switch into for row-level security, and init checks that for you.
One database function, release_due_commissions(), releases commissions whose hold has ended. Call it from pg_cron or your host's cron.
Tandem is for developers building a product where partners, agents or resellers are part of the business. If you want a CRM your team logs into today, use a hosted one. If you want a CRM and commissions inside your own product, with your own login and your own data, that is what Tandem is for.
| Tandem | Twenty | HubSpot, Pipedrive | Rewardful, FirstPromoter | Build it yourself | |
|---|---|---|---|---|---|
| What it is | A library you embed | An app you adopt | A hosted app | A hosted affiliate tool | Your own code |
| Extra server to run | None | Self-hosted: yes. Or use their cloud | None, it is theirs | None, it is theirs | Up to you |
| Inside your app and login | Yes | No, a separate app | No | No | Yes |
| Data in your own Postgres | Yes | If self-hosted | No | No | Yes |
| Lifetime commissions, holds, clawbacks | Built in | No | Not built in | Recurring, within their settings | You write it |
| History that is never overwritten | Yes | Varies | Varies | Limited | You write it |
| Team app ready on day one | Basic (Camp) | Yes, polished | Yes | Yes | No |
| Email sync, imports, integrations | Not yet | Yes | Yes | Some | No |
| Setup | A developer, about an hour | Medium | Minutes | Minutes | Weeks |
| Cost | Free, MIT | Free self-hosted, or paid cloud | Paid per seat | Paid monthly | Your time |
We list what Tandem does not do on purpose. If you need email sync, a long integration list or a polished team app on day one, pick one of the tools above. If you need a CRM and commissions that live inside your own product, that is the gap Tandem fills.
Tandem has run the sales-partner commission ledger for Utuh, our fleet compliance product, since 20 October 2026.
Sunbear, a CRM for sales agents, is built on Tandem. It is open source, so you can fork it, change it and build something better. See Sunbear →
Tandem keeps a clear record in Postgres so your app can show the whole sales journey and your team can trace what happened.
Every important change is a typed event. You can trace the story without losing earlier decisions.
Lead, payout, and activity views build from events. Rebuild them whenever you need to.
Commission amounts use whole cents or sen. Rounding is part of the rule, so the numbers stay clear.
Set a qualification threshold. Choose round robin, least loaded, or manual assignment for each lead.
Each payment earns its own commission line, held until it is ready. Rates can step down as a customer ages, and refunds and clawbacks follow the money. How it works →
Use Supabase, plain Postgres, or your own identity provider. Tandem keeps each workspace separate.
Create a lead, record a payment. That is the whole write path. Every step is one function call inside a transaction you control. See the full walkthrough.
import { createTandemPool, withTandemSession, createLead, appendLeadEvents, recordPayment, } from 'tandem-crm/db'; import { defineTandemConfig } from 'tandem-crm'; const pool = createTandemPool(process.env.DATABASE_URL); const config = defineTandemConfig({ qualification: { automatedSetupMaxQualificationMetric: 15 }, commission: { holdDays: 30, rateSchedule: [ { fromMonth: 0, basisPoints: 2500 }, { fromMonth: 12, basisPoints: 2000 }, ], }, }); // 1. A customer signs up, referred by a partner. const { leadId } = await withTandemSession(pool, adminUserId, (client) => createLead(client, { workspaceId, companyName: 'Aman Logistics', contactPhone: '+60 12-345 6789', qualificationMetric: 0, productTag: 'starter', partnerId: 'partner-1', config, }) ); // 2. They say yes. await withTandemSession(pool, adminUserId, (client) => appendLeadEvents(client, { workspaceId, leadId, events: [{ type: 'conversion.confirmed', data: {} }], }) ); // 3. They pay. Every payment earns its own commission line, held for 30 days. await withTandemSession(pool, adminUserId, (client) => recordPayment(client, { workspaceId, leadId, config, source: 'stripe', payment: { paymentId: 'inv_001', amountMinor: 10000, currency: 'MYR', confirmedAt: new Date().toISOString(), }, partnerStatus: async (id) => ({ id, active: true }), }) ); // 10,000 sen at 25% is 2,500 sen of commission, held. // release_due_commissions() runs inside Postgres. Wire it to pg_cron // or any scheduler you already have. No separate worker process.
Camp is the optional admin UI. It mounts into your Next.js app and shows leads, agents, commissions and disputes. The screens below run on sample data. Set it up in a few minutes.
Every push runs the security and money tests on Postgres 14 to 18, and again with a limited admin account like the ones managed hosts give you.
| Where | Postgres | Result | Date |
|---|---|---|---|
| Postgres 14, 15, 16, 17, 18 | 14 to 18 | Passes on every push | Every push |
| Limited admin account, not a superuser | 17 | Passes on every push | Every push |
| Neon, pooled connection | 18 | Passed | 14 Oct 2026 |
| Supabase | 17.11 | Passed | 17 Oct 2026 |
| Layerbase, pooled connection | 18.6 | Passed | 17 Oct 2026 |
| Aiven | 18.6 | Passed, using the host's CA certificate | 17 Oct 2026 |
In use: Tandem has run the sales-partner commissions for Utuh since 20 October 2026. It was checked end to end on the live Stripe account, with a real card payment and a real refund. Still early and pre-1.0: no outside developers use it yet.
Other hosts have not been tested yet. Run npx tandem-crm init against yours: it checks the one thing
that differs between hosts and tells you what to change if it fails. Some hosts, Aiven among them, secure
connections with their own certificate authority, which needs one setting. See the
database guide.
If it does not work on your host,
tell us.
A customer's journey from first lead to a clear, lasting record.
The ground truth beneath the CRM: leads, typed event history, rebuildable state, exact money math, and tenant-safe Postgres access.
Agent onboarding and certification. Teams define the checkpoints; agents complete them; your app decides what certification unlocks.
A full CRM interface for your team: leads, agents, sales activity, commissions, disputes. It mounts into your own Next.js app in one catch-all route.
Lightweight sales activity for a real CRM: calls, emails, visits, confidence, stages, corrections, and retractions without deleting history. Log CHAMP qualification when you want it: challenges, authority, money, prioritization.
Territory-aware recommendations for who should own a lead: round-robin, least-loaded, or manual. Terrain records what is true; Waypoint recommends where to go next.
A safe place to handle commission disputes. It holds a payout while a case is open and records the operator's decision.
It's MIT licensed, so you can self-host it, fork it, swap out the UI, or strip out whatever you don't need.