Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(license): new $10 Pro link + separate add-seats checkout URL

enes834dd9bcc397
diff --git a/src/core/license.test.ts b/src/core/license.test.ts
index cb0ef7134..61effd416 100644
--- a/src/core/license.test.ts
+++ b/src/core/license.test.ts
@@ -257,4 +257,38 @@ describe('license seats entitlement', () => {
expect(status.seats).toBe(0)
expect(licensedSeats()).toBe(0)
})
+
+ it('upgrade opens the base Pro link by default and the add-seats link for target "seats"', async () => {
+ process.env.NODETERM_CHECKOUT_URL = 'https://pay.test/pro'
+ process.env.NODETERM_SEATS_CHECKOUT_URL = 'https://pay.test/seats'
+ try {
+ const { initLicense } = await import('./license')
+ initLicense()
+ await flush() // let the launch refresh settle so its rejection isn't left unhandled
+ await fake.handlers[IPC.licenseUpgrade]() // default → base Pro
+ await fake.handlers[IPC.licenseUpgrade]('seats') // add-seats link
+ // Each carries this device's id for the device-bound webhook binding.
+ expect(fake.opened).toEqual([
+ 'https://pay.test/pro?client_reference_id=test-device',
+ 'https://pay.test/seats?client_reference_id=test-device'
+ ])
+ } finally {
+ delete process.env.NODETERM_CHECKOUT_URL
+ delete process.env.NODETERM_SEATS_CHECKOUT_URL
+ }
+ })
+
+ it('the add-seats link falls back to the base Pro link when unset', async () => {
+ process.env.NODETERM_CHECKOUT_URL = 'https://pay.test/pro'
+ delete process.env.NODETERM_SEATS_CHECKOUT_URL
+ try {
+ const { initLicense } = await import('./license')
+ initLicense()
+ await flush() // let the launch refresh settle so its rejection isn't left unhandled
+ await fake.handlers[IPC.licenseUpgrade]('seats')
+ expect(fake.opened).toEqual(['https://pay.test/pro?client_reference_id=test-device'])
+ } finally {
+ delete process.env.NODETERM_CHECKOUT_URL
+ }
+ })
})
diff --git a/src/core/license.ts b/src/core/license.ts
index 44e0f85aa..2ee0f6551 100644
--- a/src/core/license.ts
+++ b/src/core/license.ts
@@ -14,10 +14,15 @@ import { ENTITLEMENT_PUBLIC_KEY } from './entitlement-key'
const API_BASE = process.env.NODETERM_API_BASE || 'https://api.nodeterm.dev'
-// Stripe Payment Link (live) for the Pro subscription. The app appends ?client_reference_id=<deviceId>
-// so the webhook binds the purchase to this device → keyless ("device-bound") activation.
-// NODETERM_CHECKOUT_URL overrides it for testing (e.g. the test-mode link).
-const CHECKOUT_URL = process.env.NODETERM_CHECKOUT_URL || 'https://buy.stripe.com/9B65kFeraflH9ora4A7EQ00'
+// Stripe Payment Link (live) for the base Pro subscription ($10/mo, includes the 3 free seats).
+// The app appends ?client_reference_id=<deviceId> so the webhook binds the purchase to this device
+// → keyless ("device-bound") activation. NODETERM_CHECKOUT_URL overrides it (e.g. the test link).
+const CHECKOUT_URL = process.env.NODETERM_CHECKOUT_URL || 'https://buy.stripe.com/eVq00lbeY0qNbwz90w7EQ02'
+
+// Add-seats checkout: a quantity-based Payment Link for buying seats BEYOND the free 3 (the buyer
+// picks the total; extra seats are $5/seat/mo). Falls back to the base Pro link when unset, so a
+// single quantity-based link can serve both flows until a dedicated seats link exists.
+const SEATS_CHECKOUT_URL = process.env.NODETERM_SEATS_CHECKOUT_URL || CHECKOUT_URL
// Tokens are short-lived (the server mints 7-day entitlements) and the app is designed to
// stay open for days, so a launch-only refresh would let the token expire mid-session and
@@ -183,8 +188,11 @@ export function initLicense(onChange?: () => void): void {
// Device-bound upgrade: open Stripe checkout (carrying our deviceId), then poll the status
// endpoint until the webhook has bound + minted the entitlement. Status arrives via broadcast.
let polling = false
- platform().handle(IPC.licenseUpgrade, async () => {
- const url = `${CHECKOUT_URL}${CHECKOUT_URL.includes('?') ? '&' : '?'}client_reference_id=${encodeURIComponent(deviceId)}`
+ platform().handle(IPC.licenseUpgrade, async (target?: 'pro' | 'seats') => {
+ // 'seats' opens the add-seats (quantity) link; anything else opens base Pro. Both carry the
+ // deviceId so the same device-bound webhook binds either purchase to this machine.
+ const base = target === 'seats' ? SEATS_CHECKOUT_URL : CHECKOUT_URL
+ const url = `${base}${base.includes('?') ? '&' : '?'}client_reference_id=${encodeURIComponent(deviceId)}`
await platform().openExternal(url)
if (!polling) {
polling = true
diff --git a/src/preload/index.ts b/src/preload/index.ts
index e92a4c47a..0d05bd13e 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -301,7 +301,7 @@ const api: NodeTerminalApi = {
restart: () => ipcRenderer.send(IPC.appRestartToUpdate)
},
license: {
- upgrade: () => ipcRenderer.invoke(IPC.licenseUpgrade),
+ upgrade: (target?: 'pro' | 'seats') => ipcRenderer.invoke(IPC.licenseUpgrade, target),
activate: (key: string) => ipcRenderer.invoke(IPC.licenseActivate, key),
deactivate: () => ipcRenderer.invoke(IPC.licenseDeactivate),
getStatus: () => ipcRenderer.invoke(IPC.licenseStatus),
diff --git a/src/renderer/components/settings/sections/TeamAccessSection.tsx b/src/renderer/components/settings/sections/TeamAccessSection.tsx
index b2da88dc7..0ae031649 100644
--- a/src/renderer/components/settings/sections/TeamAccessSection.tsx
+++ b/src/renderer/components/settings/sections/TeamAccessSection.tsx
@@ -95,7 +95,7 @@ export function TeamAccessSection({
<p className="text-sm text-muted">{view.counterText}</p>
<p className="text-xs text-muted">3 included with Pro · extra seats $5/seat/month</p>
</div>
- <Button onClick={() => void ent.upgrade()}>Add seats</Button>
+ <Button onClick={() => void ent.upgrade('seats')}>Add seats</Button>
</div>
{/* Connected devices */}
diff --git a/src/renderer/state/entitlement.ts b/src/renderer/state/entitlement.ts
index ab96863ff..d107af416 100644
--- a/src/renderer/state/entitlement.ts
+++ b/src/renderer/state/entitlement.ts
@@ -9,8 +9,9 @@ interface EntitlementState {
* → 0). Mirrors `status.seats` so the Team seats section can select it directly. */
seats: number
hydrate(): Promise<void>
- /** Open Stripe checkout for this device; Pro arrives via onChange when the purchase lands. */
- upgrade(): Promise<void>
+ /** Open Stripe checkout for this device; Pro arrives via onChange when the purchase lands.
+ * `target: 'seats'` opens the add-seats (quantity) link instead of base Pro. */
+ upgrade(target?: 'pro' | 'seats'): Promise<void>
activate(key: string): Promise<void>
deactivate(): Promise<void>
}
@@ -29,8 +30,8 @@ export const useEntitlement = create<EntitlementState>((set) => {
async hydrate() {
apply(await window.nodeTerminal.license.getStatus())
},
- async upgrade() {
- apply(await window.nodeTerminal.license.upgrade())
+ async upgrade(target) {
+ apply(await window.nodeTerminal.license.upgrade(target))
},
async activate(key) {
apply(await window.nodeTerminal.license.activate(key))
diff --git a/src/shared/types.ts b/src/shared/types.ts
index 8acf2cd45..84675edcf 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -1327,8 +1327,9 @@ export interface LicenseStatus {
export interface LicenseApi {
/** Open Stripe checkout bound to this device and poll for the entitlement (no key paste).
+ * `target` picks the link: 'seats' = the add-seats (quantity) link, else base Pro (default).
* Returns the current status immediately; the active status arrives via onChange. */
- upgrade(): Promise<LicenseStatus>
+ upgrade(target?: 'pro' | 'seats'): Promise<LicenseStatus>
/** Activate a license key on this device. Returns the resulting status. */
activate(key: string): Promise<LicenseStatus>
/** Release this device's seat and clear the local license. */