# How it works (/docs/embed/how-it-works)

Four parties take part: your user's browser, your server (it holds both keys), Happierleads (the API, and the screens served on your domain) and the embedded screen. Your users only ever talk to your app; your server is the only one that talks to our API.

Three flows, each on its own page with the diagram and the API calls in order:

<Cards>
  <Card title="Start here: one-time setup" href="/docs/embed/one-time-setup" description="Your domain, embedding on, your keys, and your existing clients. Once, before your first client." />
  <Card title="Scenario 1: a client signs up" href="/docs/embed/client-signs-up" description="Your server creates their website, gives it a trial, then their first page opens the install screen." />
  <Card title="Scenario 2: a client logs in" href="/docs/embed/client-logs-in" description="Nothing is created: your server asks for a one-time link and the leads open." />
</Cards>

## What happens without you [#what-happens-without-you]

You don't need to call us for these:

- **Monthly renewal:** on `refreshOnDate` the leads refill to the plan's number and the date moves on a month.
- **Trial end:** the leads go to 0 and tracking stops, unless your webhook switched them to paid.
- **`view: "auto"`:** opens the install screen until the pixel works, then their leads.
- **Session length:** a screen stays open as long as your Embed settings say (1 week by default), then sends `session-ended` to your page.
