Customer, not user
Crovver does not know about the individual users inside a workspace. It only knows the billing unit. Your app decides which of its users belong to which customer.Your ID for the customer
Every customer carries your ID for it, theexternalTenantId, such as your workspace ID. You pass that ID on every call: to CrovverProvider as tenantId, to canAccess, to checkout and to credits. Crovver never asks you to store its own IDs.
Creating customers
B2B: create the customer from your backend when a workspace is created in your app. Then it exists with the right name and owner before it ever reaches checkout. If you skip this, the first checkout through the React SDK creates it from the provider’stenantName, userId and metadata.userEmail.
createTenant and no externalTenantId.
The billing email
A customer’s email is where Crovver sends billing messages, and it is how the customer signs in to their billing page. Before the billing page shows invoices or lets anyone cancel, it emails a one-time sign-in link to that address. Set the email when the customer is created: passownerEmail to createTenant, or let the first checkout create the customer with the user’s email. You or your team can also set it on the customer in the dashboard.
An email added later from the browser, to a customer that was created without one, is stored but not trusted for sign-in. Otherwise anyone holding your public key could attach their own address to a customer. For a customer that already exists without one, set the email in the dashboard, under Customers.
Owner
The owner is the person in your app responsible for paying, identified by your user ID,externalUserId. For a D2C customer, the owner is the customer.
When a customer counts as subscribed
A customer is subscribed while it has a subscription intrial or active, or a canceled one still inside its paid period. useSubscription().isActive tells your frontend.