> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brew.new/llms.txt
> Use this file to discover all available pages before exploring further.

# Stytch

> Trigger Brew automations from Stytch Consumer or B2B webhook events, user lifecycle, member changes, and organization activity.

Connect [Stytch](https://stytch.com) to Brew so user and team events fire automations. Send a welcome email when a Consumer user signs up, welcome the workspace owner when a new B2B org is created, or notify owners when a teammate is added or removed.

## What You Can Do

* **Trigger automations from Stytch events.** Kick off email flows from Consumer (B2C) or B2B auth events
* **Auto-sync contacts into your audience.** Every Stytch event upserts the user / member into Brew with `stytch_*` custom fields you can filter and segment on
* **Pick Consumer or B2B at connect time.** Brew filters events to the vertical you select, so Consumer connections won't fire B2B events and vice versa
* **Cover lifecycle + team workflows in one place.** Onboarding, invites, role changes, offboarding, SCIM provisioning

<Note>
  Stytch webhooks require the **B2B Pro tier** for B2B projects. Consumer webhooks ship on all paid Stytch plans.
</Note>

<Warning>
  Every marketing recipient must have opted in to hear from you. Importing or syncing contact data into Brew is not permission to email it. See [What You Can Send](/get-started/what-you-can-send).
</Warning>

## How It Works

1. Brew mints a unique webhook URL for your brand and you paste it into your Stytch Dashboard.
2. Stytch signs every webhook with your endpoint's signing secret. Brew verifies via the [Standard Webhooks (Svix)](https://www.standardwebhooks.com/) spec on receipt.
3. Brew filters events to the project type you selected (Consumer or B2B) and to `direct.*` events only, `dashboard.*` and `scim.*` source events are dropped so manual operator clicks don't accidentally email customers.
4. For each verified event Brew (a) starts every **Live** automation whose trigger matches and (b) upserts the Stytch user / member into your [audience](/audience/add-contacts) with `stytch_*` custom fields.

See [How event triggers work](/integrations/integrations#how-event-triggers-work) for the conceptual flow shared by every event-source integration.

## Setup

<Steps>
  <Step title="Generate your Brew webhook URL">
    In Brew, open **Integrations**, click the **Stytch** card, and click **Generate URL**. Copy the URL Brew generates.
  </Step>

  <Step title="Pick your Stytch project type">
    Choose **Consumer (B2C)** or **B2B** in the Brew connect form. Brew uses your selection to filter which events fire automations for this brand.
  </Step>

  <Step title="Add an endpoint in Stytch">
    Open [stytch.com/dashboard](https://stytch.com/dashboard), go to **Webhooks → + Add Endpoint**, and paste the Brew URL into the **Endpoint URL** field.
  </Step>

  <Step title="Subscribe to the events Brew supports">
    For **Consumer** projects: enable `direct.user.create`, `direct.user.update`, and `direct.user.delete`.

    For **B2B** projects: enable `direct.organization.create`, `direct.member.create`, `direct.member.update`, `direct.member.delete`, and `direct.scim_connection.create`.

    Click **Create**.
  </Step>

  <Step title="Reveal the Signing Secret">
    On the endpoint settings page Stytch shows next, reveal the **Signing Secret**. The value starts with `whsec_`.
  </Step>

  <Step title="Paste the Signing Secret into Brew">
    Paste the `whsec_…` secret into the Brew connect form and click **Connect**. Brew verifies every webhook using the Standard Webhooks (Svix) spec.
  </Step>

  <Step title="Verify it's working">
    Trigger an event in Stytch (e.g. sign up a test Consumer user, or add a member to a B2B org). Within a few seconds it should appear in the **Manage → Recent events** panel of the Stytch integration page in Brew. If it doesn't, recheck the signing secret in step 6.
  </Step>
</Steps>

<Note>
  Brew only processes `direct.*` events (real API / SDK calls). Dashboard- and SCIM-source events are dropped so manual operator clicks don't accidentally email your customers.
</Note>

## Triggering Automations

Once connected, every Stytch event below for your selected project type is provisioned automatically and available as a trigger in the [automation builder](/create-emails/automations). The **Manage** tab is a read-only catalogue plus a live **Recent events** stream, no per-event enable step. Whether an event fires is controlled by whether the bound automation is **Live**.

### Supported Events

Brew supports the following 8 Stytch events:

**Consumer (B2C)**

* `direct.user.create`
* `direct.user.update`
* `direct.user.delete`

**B2B**

* `direct.organization.create`
* `direct.member.create`
* `direct.member.update`
* `direct.member.delete`
* `direct.scim_connection.create`

<Tip>
  In chat, say *"Welcome new B2B members"* and Brew will scaffold the automation with `direct.member.create` pre-selected.
</Tip>

## Common Patterns

| Goal                                      | Stytch event                    |
| ----------------------------------------- | ------------------------------- |
| Welcome a new Consumer user               | `direct.user.create`            |
| Sync profile changes into Brew contacts   | `direct.user.update`            |
| Send a farewell email on account deletion | `direct.user.delete`            |
| Welcome the workspace owner               | `direct.organization.create`    |
| Welcome the new teammate                  | `direct.member.create`          |
| Confirm a role change                     | `direct.member.update`          |
| Offboarding email                         | `direct.member.delete`          |
| Ops alert when SCIM is wired              | `direct.scim_connection.create` |

## Personalization

These resolve as [merge tags](/create-emails/merge-tags) in the email body, subject line, and preview text. Use a fallback wherever an empty value would read badly, like `{{ firstName | there }}`.

| Variable                 | Example     |
| ------------------------ | ----------- |
| `{{ firstName }}`        | `Alex`      |
| `{{ lastName }}`         | `Morgan`    |
| `{{ organizationName }}` | `Acme Inc.` |
| `{{ role }}`             | `admin`     |

## Troubleshooting

<AccordionGroup>
  <Accordion title="An event arrived but no automation fired" icon="circle-question">
    Open the canvas and confirm at least one automation bound to this event is set to **Live** (not Draft). The Brew integration's **Manage → Recent events** panel confirms the webhook is arriving, if it isn't there, the issue is upstream (signing secret, project type mismatch, or `direct.*` source filter). If the event is there but no email sent, the only remaining gate is `automation.published`.
  </Accordion>

  <Accordion title="Consumer events don't fire (or B2B events don't fire)" icon="filter">
    Each Stytch connection is scoped to one project type: Consumer or B2B. If you need both, connect Stytch twice (one connection per project type). Check which project type you picked during setup on the Stytch integration page.
  </Accordion>

  <Accordion title="Stytch shows 401 on every delivery" icon="triangle-exclamation">
    The signing secret in Brew doesn't match the one in Stytch's Dashboard, usually because it was rotated in one place but not the other. Reveal the current secret on the Stytch endpoint settings page and re-run setup step 6 in Brew.
  </Accordion>

  <Accordion title="Dashboard or SCIM events show up as rejected" icon="info">
    Working as intended. Brew only processes `direct.*` events so manual operator actions in the Stytch Dashboard, or SCIM-driven provisioning changes, don't accidentally fire customer-facing emails.
  </Accordion>
</AccordionGroup>

## Requirements

* A Stytch account on any paid plan (B2B webhooks require **B2B Pro** or higher)
* Admin access to your Stytch Dashboard so you can add a webhook endpoint and reveal the Signing Secret

## Need Help?

Our team is ready to support you at every step of your journey with Brew. Choose the option that works best for you:

<Tabs>
  <Tab title="Self-Service Tools">
    <CardGroup cols="2">
      <Card title="Search Documentation" icon="magnifying-glass" color="#c44925">
        Type in the "Ask any question" search bar at the top left to instantly find relevant documentation pages.
      </Card>

      <Card title="ChatGPT/Claude Integration" icon="robot" color="#c44925">
        Click "Open in ChatGPT" at the top right of any page to explore it further with ChatGPT or Claude.
      </Card>
    </CardGroup>
  </Tab>

  <Tab title="Talk to Our Team">
    <CardGroup cols="2">
      <Card title="Schedule a Call" icon="calendar" color="#c44925" href="https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ1iYoRUG1J792XQpbuQLjSRRDupr7MwraFK-HQRCtTYdBmrQi8nZu2qXfzKQigb8gbKJK3KN3-R">
        Book time with our founders for personalized guidance on strategy, best practices, or complex implementation questions.
      </Card>

      <Card title="Call Us Directly" icon="phone" color="#c44925">
        Need immediate assistance? Reach us at **+1-(332)-203-2145** for urgent issues or time-sensitive questions.
      </Card>

      <Card title="Slack Channel" icon="slack" color="#c44925">
        Our preferred support channel. You'll receive an invite after signup for direct founder support and fast responses.
      </Card>

      <Card title="Email Support" icon="envelope" color="#c44925" href="mailto:support@brew.new">
        Contact us at **[support@brew.new](mailto:support@brew.new)** for detailed inquiries or if you prefer not to use Slack.
      </Card>
    </CardGroup>
  </Tab>
</Tabs>
