Mauro Venticinque
Copied

A-04

Koru Power Seller

Social selling for VTEX store sales staff. White-label and multi-tenant: one deployment serves every retailer, each with its own brand and credentials.

Specification
ClientKoru Suite · the agency's own product
Typeproducto
PlatformCloudflare Workers
Year2026
RoleAuthor
StackTypeScript · React · Cloudflare Pages · D1 · KV · VTEX Catalog · VTEX OMS · Master Data
Code10,382 lines · git ls-files ts/tsx, excluding node_modules and dist
Own commits105 of 105
Test cases90

Context

Sales staff at a VTEX store sell over WhatsApp, in the shop, on the street. They need the catalog, the real price and the ability to close the order from their phone. Each retailer wants it to look like their brand, not ours.

Options

The simple approach is one deployment per client: each retailer with its own instance, domain and variables. It is simple until the third one. After that it is three pipelines, three certificates and three different versions of the same bug.

Decision

A single multi-tenant deployment, with one hostname for everyone. The problem this creates is one of identity: if everyone comes in through the same door, the door cannot carry anyone’s logo.

The answer is a two-step login. First the email: with it, the app looks up which store that person belongs to and applies the brand —logo and color— before asking for the password. By the time you type your password you are already looking at your store.

There are two account types, and they do not share a mechanism. The administrator signs in with their Koru Suite user and has no password of their own in the app; if they manage several stores, they choose one. The salesperson signs in with an email and password given by their administrator, and has no access to Koru or the dashboard.

Verification

10,382 lines and 90 test cases on Cloudflare Pages with D1 and KV. VTEX credentials are per tenant and live on the server side.

Consequences

Multi-tenant on a single hostname means every query carries the tenant inside it, and a resolution error is a security bug, not a UI bug. That is why half the tests cover it rather than screens.

← Archive