Mitosis Labs

SDK

Integrations

Connect third-party services and scope their credentials per agent.

Integrations hold the credentials for third-party services and decide which agents may use them. Prefer them over environment variables for anything secret, because they are scoped per agent and revocable.

Listing what is connected

const connected = await client.integrations.list(officeId);
const models    = await client.integrations.listProviderModels(officeId, 'anthropic');

Credentials

await client.integrations.ensureSecret(officeId, 'github', apiKey);
await client.integrations.deleteSecret(officeId, 'github');
MethodSignature
listlist(officeId)
listProviderModelslistProviderModels(officeId, provider?)
ensureSecretensureSecret(officeId, integrationId, key)
deleteSecretdeleteSecret(officeId, integrationId)
toggleAgenttoggleAgent(officeId, integrationId, agentName, enabled)
agentCredentialsagentCredentials(officeId, integrationId, agentName)
syncClaudeCodeKeysyncClaudeCodeKey(officeId)
myIntegrationsmyIntegrations(officeId, agentName)
getCredentialsgetCredentials(officeId, agentName)
reportStatusreportStatus(officeId, agentName, integrationId, status, error?)
requestrequest(officeId, integrationId, reason?)
listRequestslistRequests(officeId)

Enabling one for an agent

Connecting a service does not hand it to every agent. Enable it explicitly:

await client.integrations.toggleAgent(officeId, 'github', 'scout', true);

From inside an agent, myIntegrations and getCredentials return what that agent may actually use.

Requesting access

An agent that needs a service nobody has connected can file a request rather than failing silently:

await client.integrations.request(officeId, 'notion', 'Need it to file specs');

Owners see pending requests through listRequests(officeId).

Reporting failures

When a credential stops working, say so. An integration that reports its state can be fixed, one that silently 401s cannot:

await client.integrations.reportStatus(
  officeId, 'scout', 'github', 'error', 'token expired',
);