# Stytch + Brew

Trigger Brew automations from direct Stytch Consumer user and B2B member events. Organization creation has no recipient; Dashboard and SCIM events do not start automations.

Canonical: https://brew.new/browse/integrations/stytch

- Direction: Data in
- Connection: Webhook secret
- Auth event triggers

## Live capabilities

- **Event triggers**: Trigger Brew automations from direct Stytch Consumer user and B2B member events with a known recipient. Organization creation, Dashboard events, and SCIM events do not start automations.

## Turn Stytch events into useful emails

Connect Stytch to start branded emails when a Consumer user signs up or a member joins a B2B organization. Brew supports 7 Stytch event types across the Consumer and B2B products.

Stytch remains responsible for authentication. Brew only listens for events and creates and sends the emails that follow them.


## What you can build

- Consumer welcome emails: direct.user.create fires when a Stytch Consumer user is created.
- Team onboarding for B2B: direct.member.create fires when a member joins an organization and carries role.
- Role-change notices: direct.member.update fires when a member record changes, such as a new role or name.
- Offboarding notices: direct.user.delete and direct.member.delete fire when a user or member is deleted. They proceed only when Brew has already seen that user or member with a real email, and they unsubscribe the contact.
- Profile sync: direct.user.update keeps the Brew contact current when a Consumer user changes.

## Only direct events start automations

Stytch labels each event with a source. Brew processes events from the direct source, which come from your API and SDK calls. Dashboard and SCIM events are recorded as unsupported and never start automations, so a change an operator makes in the Stytch Dashboard does not email customers.

direct.organization.create carries no recipient. Brew records it as unresolved and starts no automation. To email a person, use direct.member.create, which carries the member address.

Delete events carry only an ID. Brew looks up the email it saw earlier for that user or member on the current connection. If it has none, the event is recorded as unresolved.


## Set up Stytch in Brew

- Open Integrations, choose Stytch, and select Connect Stytch.
- Choose the project type that matches your Stytch project, Consumer (B2C) or B2B.
- In the Stytch Dashboard, open Webhooks and add an endpoint with the Brew URL.
- 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, and direct.member.delete.
- Reveal the endpoint signing secret, which starts with whsec_, paste it into Brew, and select Save and connect. Brew verifies every delivery with the Standard Webhooks (Svix) spec.
- In Stytch, open the endpoint Testing tab, pick direct.user.create or direct.member.create, and select Send Example. Brew changes from "Waiting for the first event" to "Connected". An example only verifies the webhook. Brew adds no contact and starts no automation.
- Connecting creates triggers for all 7 events. There is no event enable/disable switch.
- Create an automation, select its Stytch event, and send a test while it is still a Draft. Only Live automations execute when a matching event arrives.

## Supported Stytch events

direct.user.create, direct.user.update, and direct.user.delete come from Consumer projects. The organization and member events come from B2B projects.

Brew supports these 7 event types:

- direct.user.create
- direct.user.update
- direct.user.delete
- direct.organization.create
- direct.member.create
- direct.member.update
- direct.member.delete

## Contact sync and personalization

Each verified event with a real email address creates or updates a Brew contact, matched by email, whether or not an automation uses the event. When the data is present, Brew sets first and last name and stytch_project.

Consumer events set stytch_user_id. Member events set stytch_member_id, stytch_organization_id, and stytch_org_role. Both set stytch_account_status, stytch_created_at, stytch_email_verified, and stytch_phone, and trusted_metadata values land as stytch_metadata_<key>.

stytch_account_status is active, invited for a pending user or a pending or invited member, or deleted after a delete event. A delete unsubscribes an existing contact unless it holds a different Stytch user or member ID, and never creates a contact. Brew does not remove the contact.

Use the selected event's declared payload schema for merge tags. Every event includes email, firstName, lastName, and createdAt when present. Member events add role, and direct.organization.create adds organizationName and organizationSlug. createdAt is a Unix timestamp in seconds.

Stytch user, member, and organization IDs are not merge tags. They land on the contact as stytch_* fields instead.

A Stytch account does not establish consent for marketing email. Record consent at sign-up and check it before promotional sends.


## Does Brew replace Stytch's authentication messages?

No. Stytch's own authentication messages are unchanged. Brew starts automations from the webhook events listed here, after Stytch has created, updated, or deleted the user or member.


## Why does an event appear without sending an email?

Receiving an event and sending an email are separate steps. Confirm a matching automation is Live, then check its filters, execution history, recipient eligibility, and sending domain. Send Example deliveries, dashboard and SCIM events, and events without a known recipient never start automations.


## Limits and troubleshooting

- Brew cannot create or change Stytch users, members, or organizations.
- If Stytch reports 401 on every delivery, the signing secret in Brew does not match the endpoint secret. Reveal the current secret and connect again. Brew requires it to start with whsec_ and be at least 24 characters.
- Review consent and the purpose of each email. Syncing Stytch users does not authorize promotional sends.

## Sources and setup guides

- [Stytch setup guide](https://docs.brew.new/integrations/import/stytch)
- [Build an automation](https://docs.brew.new/create-emails/build-an-automation)
- [Merge tags](https://docs.brew.new/create-emails/merge-tags)
- [What you can send with Brew](https://docs.brew.new/get-started/what-you-can-send)
- [Stytch webhooks](https://stytch.com/docs/resources/workspace-management/webhooks)

## Related

- [All integrations](https://brew.new/browse/integrations.md)
- [Sign up](https://brew.new/sign-up.md)
- Website: https://brew.new
