This page explains the Vercel integration and how to use the keys it installs. Field-by-field API details live in the Email Reputation, Phone Intelligence and IP Intelligence references.
Summary for coding agents
If you are an AI coding agent adding Abstract checks to a project on Vercel, these are the facts and rules to follow:- The integration adds up to three environment variables to the selected Vercel projects, one per product the user picked. Only call a product when its variable is set.
- Call the APIs from server code only: Server Actions, Route Handlers or other server-side functions. Never import the keys into a Client Component, never prefix them with
NEXT_PUBLIC_, and never log them. - Send the key in the
Authorization: Bearer <key>header. Do not put it in the URL. - Run the checks you need in parallel with
Promise.all, each with a 5 second timeout. - Fail open. If a variable is missing, a call times out, or the API returns an error, skip that check and continue. Never block a user because a check could not run.
- Check the visitor’s IP address, taken from the
x-forwarded-forrequest header on Vercel, never the server’s own IP. - Send phone numbers with their country code, digits only (for example
14155550123). A 10-digit number without a country code can be read as a number from another country. - Keep the decision logic (allow, review, block) in one place so the user can tune it.
- After you change environment variables, or the user adds products in the integration, the project needs a redeploy for running deployments to see the new values.
What the integration does
The Abstract API integration connects a Vercel team to an Abstract account and writes Abstract API keys into the Vercel projects you choose. It does not change your code: you call the APIs from your application with the keys it installs. Install it from vercel.com/integrations/abstract-api. During the install you sign in to Abstract (or create a free account), pick the products, and pick the Vercel projects.Environment variables
Email Intelligence is served by the
emailreputation endpoint and documented in the Email Reputation reference. They are the same product.- Each variable holds the key of your Abstract account for that product, on your current plan. Each call uses one request from that product’s plan.
- The variables are stored as Vercel Sensitive variables: their values cannot be read back in the Vercel dashboard.
- Only the products you picked are added. You can add products or projects later from the integration’s Configure button.
Add the checks to your app
The examples use the Next.js App Router. The same calls work from any server-side code on Vercel.1. A shared client
Create one helper that every check uses. It reads the key from the environment, sends it as a Bearer token, applies a timeout, and returnsnull instead of throwing, so callers can fail open.
lib/abstract.ts
2. The visitor’s IP address
lib/client-ip.ts
127.0.0.1 or ::1. Skip the IP check for those addresses instead of sending them.
3. Signups
Check all three signals before the account exists. Block the clear cases, flag the uncertain ones for review, and allow the rest.app/signup/actions.ts
4. Logins
At login you usually only have the IP address. Check it on the server before you issue the session.5. Checkout
Compare where the email, phone and connection point. A mismatch is a reason to review an order, not to refuse payment on its own.Fields used on this page
Any field can be
null when Abstract has no data for it. Treat null as “no signal”, not as false.
Errors and limits
All errors return JSON with
error.message and error.code. The helper above returns null for every one of them, which keeps signups, logins and checkouts working.
Run locally
Link the project and pull its environment variables:.env.local under the same variable name. Never commit .env.local.
Change, rotate or remove
- Add products or projects: open the integration in Vercel and click Configure. Redeploy the affected projects afterwards.
- Rotate a key: rotate it in the Abstract dashboard. The integration writes the new key to every linked project. Redeploy them so running deployments use it.
- Revoke a key: revoking a key in Abstract does not remove it from Vercel. Calls with it return
401until you link another key from Configure. - Uninstall: Abstract does not delete the environment variables, your account or your keys when you remove the integration, so running deployments keep working.
Starter template
The Abstract signup template is a Next.js app that runs all three checks on a signup form, with the rules in one file (src/lib/rules.ts). Deploy your own copy with the button in its README, or copy src/lib/abstract/ and src/lib/rules.ts into an existing app to reuse the same logic.