Keep this workspace
Let a visitor take the records they created in your demo into the account they open afterwards, instead of starting from an empty trial.
const grant = await demo.verify(identity, "workspace.keep");
const bundle = await exportResource(demoDb, grant, recipes, 1);
const { code } = await demo.keep(identity, bundle, TRANSFER_KEY);
// In your production app, after signup:
const kept = await demo.redeem(code, TRANSFER_KEY, { schemaVersion: 1 });Turn it on
Give every recipe an export function that returns only rows the visitor created, never seed rows. Pass transfer: { schemaVersion: 1 } to postgresAdapter, and add the workspace.keep action to each scenario that should offer it.
Save from the demo
When the visitor chooses to keep their work, verify the workspace.keep action, call exportResource, then demo.keep(identity, bundle, transferKey). Send the returned one-use code to your signup in a POST body, never in a URL.
Import after signup
Once the visitor has an account in your production app, call demo.redeem(code, transferKey, { schemaVersion }). Validate every record, then write them in one transaction.
What Trylane stores
Your demo and production apps share a 32-byte transfer key that Trylane never receives. Trylane holds only encrypted records bound to that session, for 24 hours or until redeemed, up to 192 KiB. A claim code works once and only for your product.
See every step from the visitor’s side.
Try the Ledger example