Skip to content

Variations ​

The Quickstart keys every profile by your own user ID. Until the user links a Configure account, the profile is scoped to your developer account. Your secret key controls access. Other developers cannot access it, and it is not available across their agents.

Every snippet here uses the handle from the Quickstart, built once on your server. Reads and writes match the Quickstart too. Use profile.read() for the daily refresh and profile.commit({ messages }) at the end of every turn. There is no profile.write or profile.save.

ts
import { Configure } from "configure";

export const configure = new Configure({
  apiKey: process.env.CONFIGURE_API_KEY,   // sk_..., server only
  agent: process.env.CONFIGURE_AGENT,      // your agent handle
});

export const profileFor = (userId: string) => configure.profile({ externalId: userId });

They can link at any time, through the same button. When they do, their profile migrates in place. Nothing is lost, and the externalId you use does not change.

Account linking changes agent approvals.

Linking clears every agent's approval for that user. The connect page re-grants only the one agent the user approved. Before linking, your agents can access the developer-scoped profile. After linking, the user controls which agents can access it.

Other agents must request approval after the user links:

ts
try {
  const read = await profile.read({ sections: ["identity", "preferences", "summary"] });
} catch (err) {
  // approval_required: 403, code ACCESS_DENIED, suggestedAction "complete_approval".
  if (err.suggestedAction === "complete_approval") {
    // Your key is no longer authority over this user. Ask them.
    const { connect_url } = await profile.connect({ returnUrl: RETURN_URL });
    return res.redirect(connect_url);
  }
  throw err;
}

RETURN_URL and the redirect are the ones from Quickstart, step 3. The SDK reports this refusal as ACCESS_DENIED with statusCode 403. Match on suggestedAction, not on code. profile.connect() and profile.mcpSession() keep working while approval is outstanding, so you can create the connection URL for authorization. Profile reads and writes require user approval.

Handle approval_required once, in the code that wraps your Configure calls. The rest of your code then never sees it.

Sign in with Configure ​

Configure can be your account system, instead of a profile next to your own accounts. See Sign in with Configure.

Other integration options ​

  • Your agent has no screen (SMS, voice, a CLI, a scheduled job). The created link takes the place of the button. See Message agents.
  • You do not own the model loop (the user runs Claude, ChatGPT, or a coding agent). Configure the MCP client with mcp.configure.dev. See MCP. This is the only case where connecting MCP is the whole integration, because the host has its own read and save behavior. In every other case, MCP alone is not enough. Your server must inject context before the first turn and commit conversation messages.

Infrastructure to connect agents, apps, and chats