One checkout.
Every market.
Zero vendor lock.
Reactive payment orchestration for modern web apps. The right provider, the right methods, the right flow, picked in the browser the moment your app knows enough to decide. Headless, typed, MIT.
Today: Stripe and Polar, with React bindings. More providers and payment methods are planned.
The rules run through the real router, in your browser. The checkout is a preview: no provider is called.
A checkout that knows what your app knows.
Every payment SDK lets you take a payment. Tenderlane decides which payment to take, in the browser, the moment the context changes, with types that hold across providers, markets and methods.
Adapts the second your app does.
When the customer changes country, currency or cart, the checkout re-routes in the same render: provider, payment methods and flow. No reload, and no request to your server to decide.
Works today
Your UI. Your stack. Any provider.
Headless components, a core that knows no framework, and adapters you can swap. Start on Stripe. Add Polar as your merchant of record. Write an adapter for your local provider with the same API ours use.
Stripe, Polar and React today · more providers and frameworks planned
Routing rules are data, not code.
A JSON shape where the first match wins. Store rules in a database, ship them from a feature flag, and catch the typo in "gpb" at compile time.
Works today · no rule editor yet
What checkout routing usually looks like.
The same requirement both times: "show TWINT in Switzerland, fall back to Stripe Checkout everywhere else." Left: how it tends to get written. Right: how it reads with Tenderlane.
const [provider, setProvider] = useState('stripe');
const [methods, setMethods] = useState(['card']);
const [flow, setFlow] = useState('checkout-session');
// re-run when country changes
useEffect(() => {
if (country === 'CH') {
setFlow('payment-intent');
setMethods(['card', 'twint']);
} else if (country === 'NL') { /* … */ }
}, [country]);
// re-run when currency changes
useEffect(() => { /* … */ }, [currency]);
// ...and the same conditions again in the submit handler and the API route. - Provider and method names are plain strings, so a typo ships
- The outcome depends on which effect ran last
- The same conditions are repeated on the server, or not checked there at all
- Changing a rule means changing code in three places
import { createRulesRouter } from '@tenderlane/core';
export const routing = createRulesRouter({
rules: [
{
id: 'ch-inline',
when: { country: 'CH', currency: 'chf' },
use: { provider: 'stripe', flow: 'inline', paymentMethods: ['card', 'twint'] },
},
],
fallback: { provider: 'stripe', flow: 'hosted', paymentMethods: ['card'] },
});
// The checkout page and the server both read this.
// Rules are plain data: keep them in code, a database or a feature flag. - Provider, flow, country and currency are checked by the compiler
- The first rule that matches wins, and that is the whole contract
- The route follows the context synchronously: no effects to race
- Rules are JSON: test them, store them, ship them from a flag
The whole integration, on screen.
One file, one provider, one router. Experiments, more providers and your own adapters build on this same shape. This is a real file from the repository, typechecked in CI.
import { TenderlaneCheckoutForm, TenderlaneProvider } from '@tenderlane/react';
import { stripeProvider } from '@tenderlane/stripe';
import { StripePaymentElement } from '@tenderlane/stripe/react';
import { routing } from './routing';
const stripe = stripeProvider({
publishableKey: 'pk_test_...',
serverEndpoint: '/api/payments',
});
export function Checkout({ country }: { country: string }) {
return (
<TenderlaneProvider config={{ context: { country }, providers: [stripe], routing }}>
<TenderlaneCheckoutForm
input={{
items: [{ sku: 'pro-plan', quantity: 1 }],
successUrl: 'https://shop.example/success',
cancelUrl: 'https://shop.example/cancel',
}}
elements={{ stripe: StripePaymentElement }}
>
{({ submit, canSubmit, error }) => (
<>
<button disabled={!canSubmit} onClick={submit}>
Pay
</button>
{error && <p role="alert">{error.message}</p>}
</>
)}
</TenderlaneCheckoutForm>
</TenderlaneProvider>
);
} The compiler knows which providers you registered.
A rule that names any other provider does not compile. Neither does a mistyped currency or flow. These are real errors: the file only compiles because each one is marked as expected.
createRulesRouter({
rules: [
{
id: 'uk',
// @ts-expect-error Type '"gpb"' is not assignable to type 'CurrencyCondition'.
when: { currency: 'gpb' },
use: { provider: 'stripe', flow: 'hosted' },
},
],
// @ts-expect-error Type '"embedded"' is not assignable to type 'PaymentFlow'.
fallback: { provider: 'stripe', flow: 'embedded' },
});
createTenderlaneClient({
context: {},
providers: [stripe],
// @ts-expect-error Type '"stripe" | "polar"' is not assignable to type '"stripe"'.
routing: createRulesRouter({
rules: [{ id: 'us', when: { country: 'US' }, use: { provider: 'polar', flow: 'hosted' } }],
fallback: { provider: 'stripe', flow: 'hosted' },
}),
}); Four layers. Each one swappable.
A core that knows nothing about your framework, a headless state machine on top, framework bindings, and provider adapters. The layering is inspired by TanStack; this is an independent project.
Types, rules router, catalogs, errors, and the server handler that sets the price and confirms payments. Zero runtime dependencies.
A headless state machine with no framework: ready → submitting → success, redirecting or pending.
React provider, hook and form via useSyncExternalStore. Vue is experimental (hosted flow only). Svelte and Solid are planned.
One per provider. Stripe and Polar today. Stripe.js is loaded only when an inline route needs it.
* Stripe.js is loaded only when an inline Stripe route needs it. A hosted-only checkout ships no provider JavaScript. Next.js is the only server runtime tested so far.
See it route, before you ship it.
A playground that runs the real router, an example you can pay through without an account, and the adapter guide.
Reactive routing playground
Change country, currency and plan. Edit the rules. Watch the route, the methods and the total follow. The checkout itself is a preview.
{ country: 'CH', currency: 'chf' }
// → ch-inline · stripe · card, twint The example checkout
A Next.js app that pays through a labelled demo provider: server-side pricing, a hosted page, a signed webhook and a confirmed order. Add Stripe test keys for the real thing.
pnpm install
pnpm example # http://localhost:3000 Write your own adapter
A provider is two small objects. The demo provider in the example is a complete one, written with the same entry point the Stripe and Polar adapters use.
defineBrowserProvider({ id: 'acme', ... })
defineServerAdapter({ id: 'acme', ... }) Three rules the codebase lives by.
Tenderlane is not a backend payment wrapper. It connects what your application knows to the providers that take the money, and it has opinions about how.
Frontend-first orchestration
Routing happens in the browser, where the app already knows the user's country, currency, experiment variant, and cart shape. The server handler sets the price, checks the route again and confirms the payment. It does not decide what to render. State changes the UI; the UI does not wait on a request.
Typed end-to-end
Provider ids stay string literals all the way from the adapters you register to the rules you write. A rule that names a provider you did not register does not compile, and neither does a mistyped flow or currency. A checkout status narrows the fields you can read.
Provider-agnostic by default
`@tenderlane/core` has zero runtime dependencies and never imports a provider SDK. Stripe, Polar and every future adapter live behind the same contract. Swap providers, run two side by side or A/B test them, without rewriting your checkout UI or your server.
Honest scope. Pre-1.0.
The page above describes where Tenderlane is going. This is how much of it exists today.
- Rules router, shared by the browser and the server
- Headless checkout client, typed by status
- React bindings via useSyncExternalStore
- Stripe: Checkout (hosted) and Payment Element (inline)
- Polar: hosted checkout
- Server-side pricing from a catalog (inline, remote, Stripe or Polar)
- Payment confirmation: order hook, status lookup, verified webhooks
- An adapter API for your own provider
- Vue bindings: hosted flow only, no example
- Webhooks: payment events only; no refunds, disputes or subscriptions
- Stripe test-mode suite: written, not yet run
- Polar: mocked tests only, one product per checkout
- More providers: Adyen, Paddle, PayPal, Mollie
- Subscriptions and refunds
- Failover between providers
- Svelte and Solid bindings
- Polar embedded checkout
- A rule editor and devtools
- npm releases and a stable 1.0
Don't request a demo.
Just read the code.
MIT and on GitHub. No sales call, no "talk to us". It is an alpha: clone it, run the example without an account, then add Stripe test keys and route a real test payment.