Skip to main content
Ask for a work email once, retrieve the associated Brand profile on your server, and prefill the next onboarding step. Use the same confirmed identity to seed a workspace theme. The user should always be able to correct or skip the result. You’ll need a server-side API key from the Quickstart. Each successful Brand lookup costs 10 credits. The example uses a Next.js route, but the same request works from any backend.

Retrieve a company profile

Use any supported SDK for the underlying lookup. The PHP tab uses the SDK’s low-level Brand method; the backend and UI example below uses TypeScript and React.

What to prefill

Every field is optional. A successful response can still contain a partial profile.

Look up the company

The browser calls your backend. Your backend validates the email and calls Context.dev with CONTEXT_DEV_API_KEY. Here is a Next.js route using the HTTPS API directly so the fallback behavior is explicit:
app/api/company-profile/route.ts
Do not return the upstream response wholesale. Send only the fields your form uses, and never expose the Context.dev API key or internal diagnostics to the browser.

Fill blank fields

Start the lookup when the user submits the email step. Fill only blank fields so a slow response cannot replace edits made while the request was running.
Show the lookup as a convenience, not as verified user input:
  • Label the step “Confirm your company details.”
  • Make text fields editable and the logo replaceable.
  • Let the user continue when no profile is found.
  • Do not treat a physical address as a legal or headquarters address without separate verification.
  • Record which values the user confirmed if downstream logic depends on them.

Seed an editable workspace theme

After the user confirms the company, use brand.branding from the route above as suggestions for that tenant. Listener uses brand context for customer-specific experiences; the same pattern can personalize a workspace header or customer portal. Keep automatic candidates separate from saved user choices. A logo may belong to a parent brand or the platform hosting the website, so provide a replacement or Use no logo option.
workspace-theme.ts
Map these roles to your component system rather than copying the whole extracted palette:
Workspace header
The accent above is decorative. Before using it behind text or on controls, choose a contrasting foreground and test the resulting states, as in the website theme recipe. Reserve dimensions and retain the company name when adding a logo. Save ThemeChoices against your tenant ID, independently from the automatic Brand snapshot. Refresh only the suggestions; reapply saved choices afterward. Do not apply a late lookup for an earlier email address to the current form or tenant: associate each response with the email and request that initiated it.

Keep signup resilient

If you know the email before the profile is needed, subscribers can queue a prefetch. Prefetch is an optimization, not a completion signal; the later Brand response remains the source of truth. Run email validation and abuse controls before the upstream call. Track matched, unmatched, partial, and failed lookups without logging full email addresses unnecessarily.

Retrieve a brand by email

Map work email addresses to company profiles.

Prefetching

Queue a lookup before the profile is needed.

Generate a branded website

Turn confirmed branding into a complete editable page theme.

Troubleshooting

Understand invalid email responses.