Skip to content

Connect X1 to your Vercel app

Use X1 from apps and agents you deploy on Vercel.

Create an X1 connector in Vercel Connect. Each person who uses your app signs in to X1 once and approves the access, and your code asks for their token when it needs one.

Start free in X1

Vercel Connect keeps third-party tokens out of your environment variables and hands your code a short-lived one when it asks. Through Vercel Connect, an app or agent you deploy reads a household's record (the trusts, companies, properties and the documents behind them) as the person who approved it, with the source attached to each answer.

Connect X1 in four steps.

You need a Vercel project and an X1 account to test with, and a free one works. Sign in with your own account first so you can check the answers against your own documents.

  1. 01

    Create an X1 connector

    In the project that will call X1, run vercel link, then vercel connect create x1-wealth --name your-connector, then vercel connect attach x1-wealth/your-connector so the project's environments can ask for tokens. A connector created from the project's Connect page in the Vercel dashboard is attached for you. Run vercel env pull to get the Vercel OIDC token your code uses locally.

  2. 02

    Ask for the person's token

    In your server code, call getToken('x1-wealth/your-connector', { subject: { type: 'user', id } }) from @vercel/connect, using your app's own ID for the person. Take that ID from your app's signed-in session, never from the request, or one person could reach another household's record. X1 access always belongs to one person who signed in to X1, so ask for a user token.

  3. 03

    The person signs in to X1

    The first time, getToken throws UserAuthorizationRequiredError. Call startAuthorization with the same subject and send the person to the URL it returns. They sign in to X1 with their own account and approve the access. Vercel Connect then keeps and refreshes the token, and your app never sees their X1 password.

  4. 04

    Call X1

    Send the token as an Authorization: Bearer header to https://mcp.x1wealth.com/mcp. With the AI SDK, give the MCP client connectAuthProvider('x1-wealth/your-connector', { subject: { type: 'user', id } }) from @vercel/connect/ai-sdk as its authProvider instead; the first time, it throws ConsentRequiredError, and you send the person to its url. Call get_user_capabilities first to see what this person's connection can do, then ask one question whose answer names a document.

Start with a question you can check.

  • Use X1: who owns the rental property, and which documents show it?

    The answer names each document, so your app can show the source next to the claim.

  • Use X1 to list the trusts, companies and properties in this household and who owns each.

    Your app starts from the household as X1 holds it, with no copy of its own to keep in sync.

  • Use X1 to review the new K-1. What does the record support, and what should we ask the CPA?

    It keeps the review tied to the source and ends with a concrete question.

What your app can do with X1.

  • Answer questions from the person's household record, with the document behind each answer.
  • Search the documents their access allows for the passage that supports a fact.
  • Show the businesses, trusts and properties in the record, and the changes waiting for confirmation.
  • Keep the work moving within what their X1 account allows. X1 asks for their approval when a step needs it.

Each token acts as one person and reaches only what that person's X1 account can reach. In X1 under Settings, Connections, every app built with Vercel Connect that a person approved appears as one entry, listed as Vercel Connect after its first request to X1. Turning it off there ends access for all of those apps.

If a step doesn't work.

getToken throws UserAuthorizationRequiredError
That person hasn't approved X1 for your app yet. Call startAuthorization with the same subject and send them through the X1 sign-in.
getToken throws NoValidTokenError
The connector can't produce a token for that person any more, which happens when they turn Vercel Connect off in X1 under Settings, Connections. Call startAuthorization with the same subject and send them through the X1 sign-in again.
Vercel Connect answers 403 forbidden
Vercel Connect refuses tokens to a project or environment the connector isn't attached to. Run vercel connect attach x1-wealth/your-connector from the project, or add the environment to the connector's project link, then run vercel env pull again for local work.
X1 answers 401 Unauthorized
X1 no longer accepts that token. Drop it with deleteTokenCacheEntry and ask for a new one. If X1 refuses that too, send the person through startAuthorization again.
X1 says this connection can't use a tool
Either the person's X1 account doesn't include that tool, or the person hasn't turned it on. What's waiting on you and Full project details stay off for each new Vercel Connect sign-in until the person turns them on in X1 under Settings, Connections. get_user_capabilities lists what this connection can read and do, so check it before your app promises a feature.

Questions about your Vercel app and X1.

Who can sign in through my app?
Anyone with an X1 account, including a free one. Each person signs in with their own account, and your app gets only what that account can reach.
Why a user token and not an app token?
Every X1 connection belongs to a person who signed in and approved it. That keeps one household's record from reaching an app no one in the household agreed to.
Where is the token kept?
Vercel Connect stores and refreshes the X1 token for your project. Your code asks for it when it needs one and calls X1 with it, so no X1 credential sits in your environment variables.
Should development use the same connector as production?
No. Anyone on your team who can run vercel env pull for an attached environment can ask for a token as any person who approved that connector. Use a separate connector for Development and Preview, approved with your own test X1 account, and attach the production connector to Production only (vercel connect attach x1-wealth/your-connector -e production).
Can I use an X1 API key instead?
If your X1 plan includes API keys, a key works as an Authorization: Bearer header to the same address. A key acts as you, though, so it suits a script for your own household, not an app other people sign in to.
Can an app move money through X1?
No. X1 doesn't trade or move money from a connected app, and an app can't approve anything on the person's behalf.

Connect one household and check one answer.

Create the connector, sign in with your own X1 account first, and ask your agent one question whose answer names the document.

Using a different assistant? Claude, ChatGPT, Codex, Muse, Microsoft Copilot, the x1 terminal, or any other MCP app. Or read how to set up an AI assistant for your family's finances.