Getting started

Connecting services

Let changes send email: connect Resend, and set its keys where your app runs (Vercel, Railway, your machine).

Some changes need an outside service. Today that means sending email: "email the form's answers to me". Revyse handles these in one of three ways:

  • Your project already sends email (Resend, Nodemailer/SMTP, SendGrid, Postmark, Mailgun or Amazon SES): Revyse writes the code against what you have. If the change needs new variables, it names them for you to set.
  • It doesn't, and your organization has connected Resend in Revyse: Revyse does three things. It adds the Resend SDK, writes server-side code that sends the email, and names the variables. You set them where the app runs with one confirmation.
  • It doesn't, and nothing is connected: Revyse stops and asks you to connect a service first, so the change isn't left half-working.

This guide connects Resend (email) and Railway (where your app runs), sets the variables, and covers rotating and disconnecting keys.

You need

  • The agent engine: "engine": "agent" in revyse.config.json (see supported changes).
  • The owner role in the organization. Only owners connect, rotate and disconnect services, set variables on hosts, and pull them to a machine.
  • If your app deploys on Vercel: the Revyse Vercel integration installed and the project mapped under Previews (see the cloud quickstart). The integration needs its environment-variable permission. If you installed it before that was added, approve the updated permissions in Vercel.

1. Connect Resend

  1. Create a Resend account at resend.com.

  2. In Resend, open Domains → Add domain. Add the domain you send from, then add the DNS records it lists, and wait until it shows as verified.

  3. In Resend, open API Keys → Create. Give the key Sending access only, for that one domain. A full-access key also works, but Revyse will suggest the narrower one.

  4. In Revyse, open the organization's Integrations and find Services → Resend:

    • Paste the key into Resend key.
    • Enter the Sender, an address on the verified domain, such as Acme <hello@acme.com>.
    • Press Connect Resend.

    Revyse checks the key with Resend before saving it, using a read-only call. You'll see "The key works, with sending access only."

From then on, the card shows "Connected, key ending abcd". The key itself is never shown again.

Enter keys on the dashboard only. Revyse refuses a request, an answer or feedback that contains a key, and the overlay never asks for one.

2. Connect Railway (if your app runs there)

  1. In Railway, open the project, then Settings → Tokens. Create a project token for the environment the app runs in, for example production. An account token won't work.
  2. In Revyse, under Integrations → Services → Railway, paste the token into Railway key and press Connect Railway. Revyse checks it and learns which project and environment it is for.
  3. Under Service that runs the app, pick the Railway service that runs your app, then press Use this service.

3. Set the variables where your app runs

In the project's Settings, under Service variables → Resend:

  1. Tick where to set them: Vercel (production and preview, as encrypted variables), Railway (the service you picked), or both.
  2. Tick Set RESEND_API_KEY and EMAIL_FROM on the places ticked above.
  3. Press Set the variables.

Each host succeeds or fails on its own, and a failure says what to fix (see Troubleshooting). Settings then lists where the variables are set and when. Your app picks them up on its next deployment.

4. Use them on your machine

In the project directory:

npx revyse env pull

It shows the variable names and asks before writing them to .env.local. It writes only if git ignores .env.local, and refuses otherwise, so the key can't be committed by accident. The file is readable by you only. Use --file .env.development.local to write elsewhere. Restart your dev server afterwards.

Pulling is for owners only, and each pull is recorded in the organization's audit trail, by variable name.

5. Ask for the change

Select an element and describe the change, for example:

Add a catering enquiry form under this section: name, email, event date and number of guests. When it's submitted, email the details to orders@example.com and show a thank-you message.

The plan lists the variables the change uses (RESEND_API_KEY, EMAIL_FROM). When you approve it, Revyse:

  • adds resend at the version Revyse supports, through your package manager, with an exact version and lifecycle scripts off. package.json and the lockfile become part of the change, and revert with it;
  • writes the sending code to run on the server (a server action or a route handler), so the key never reaches the browser;
  • runs your checks. In the cloud, checks get placeholder values for the keys, never the real ones.

If nothing is connected yet, the overlay shows This needs an email service, with a link to connect it on the dashboard. Once you've connected it, press I've connected it: plan again.

Rotating a key

  1. Create a new key in Resend, as in step 1.
  2. Under the organization's Integrations, paste it into New Resend key and press Replace the key.
  3. The project's settings mark each host that still has the old key: "Vercel still has the old key: set them again". Set the variables again (step 3) and run npx revyse env pull on each machine.
  4. Delete the old key in Resend.

Disconnecting

Under the organization's Integrations, press Disconnect Resend. To remove RESEND_API_KEY and EMAIL_FROM from every host Revyse set them on, first tick Also remove the variables Revyse set from your hosts. Revyse deletes the stored key at once. Copies in .env.local files on developers' machines are theirs to delete.

Where your keys go

Goes to Never goes to
The service itself, once, to check the key The AI model, in any form
The hosts you tick (Vercel, Railway) Cloud workspaces: their checks get placeholder values
.env.local on an owner's machine, through revyse env pull Logs, the audit trail (names only), diffs, pull requests, check output

Keys are stored encrypted, scoped to the organization. Revyse also recognises a key in places it shouldn't be: if your app prints one in a check's output, Revyse redacts it. If a file in your project has a key hard-coded, Revyse leaves that file alone and suggests moving the key to an environment variable. More in how Revyse handles your code and data.

Troubleshooting

You see What to do
"Resend didn't accept the key: …" Copy the whole key again; check in Resend that it wasn't deleted.
"Railway didn't accept the token" Use a project token (project → Settings → Tokens), not an account or team token.
"Vercel answered 403 … environment-variable permission" Approve the Revyse integration's updated permissions in Vercel, then set the variables again.
"Pick the Vercel project that deploys this project first" Map the Vercel project in the project's settings, under Previews.
"Pick the Railway service that runs the app under the organization's Integrations first" Choose it under Integrations → Services → Railway (step 2.3).
".env.local isn't ignored by git, so the keys could be committed" Add .env.local (or .env*.local) to .gitignore, then run npx revyse env pull again.
"Only project owners can pull service variables." Ask an owner to pull, or to make you an owner.
"That looks like an API key or token. Don't paste keys into a request…" Remove the key from your request. Connect the service under the organization's Integrations instead.