Skip to content

ConfigureClient

The main entry point for the Configure TypeScript SDK. Creates module instances for authentication, profile management, tool operations, and storage access.

This section documents SDK methods and types. The endpoint-by-endpoint wire contract is separately navigable as the API Reference.

Import

typescript
import { ConfigureClient } from 'configure';

Constructor

typescript
new ConfigureClient(apiKeyOrOptions?: string | ConfigureClientOptions, options?: ConfigureClientOptions)

Creates a new ConfigureClient instance.

If apiKey is omitted, the SDK reads from the CONFIGURE_API_KEY environment variable.

Parameters

NameTypeRequiredDescription
apiKeyOrOptionsstring | ConfigureClientOptionsNoYour Configure API key (sk_... or pk_...), or an options object. Falls back to CONFIGURE_API_KEY env var.
optionsConfigureClientOptionsNoClient configuration options (only when first argument is a string).

Options

NameTypeDefaultDescription
apiKeystringCONFIGURE_API_KEYAPI key when using an options object.
baseUrlstringhttps://api.configure.devAPI base URL. Also reads from CONFIGURE_BASE_URL env var.
agentstringCONFIGURE_AGENTAgent slug. Required when the key's developer account has more than one agent.
userIdstringundefinedExternal user ID. Sends X-User-Id for unlinked server-side profiles. Requires sk_... for API access.
timeoutnumberundefinedRequest timeout in milliseconds.
fetchtypeof fetchglobalThis.fetchCustom fetch implementation for environments without native fetch.

Example

typescript
// Reads API key from CONFIGURE_API_KEY env var
const client = new ConfigureClient();

// Server-side — secret key (full API access)
const client = new ConfigureClient('sk_your_api_key');

// Client-side — publishable key (auth, profile reads, tool connections)
const client = new ConfigureClient('pk_your_publishable_key');

// Options object as first argument
const client = new ConfigureClient({
  apiKey: 'sk_your_api_key',
  agent: 'my-agent',
  baseUrl: 'https://api.configure.dev',
  userId: 'user_123',
});

// String API key + options object
const client = new ConfigureClient('sk_your_api_key', {
  baseUrl: 'https://api.configure.dev',
  timeout: 30000,
});

Module Access

All SDK functionality is accessed through module properties on the client instance.

ModulePropertyDescription
Authclient.authOTP authentication (send/verify).
Profileclient.profileUser profile CRUD, memories, ingestion, agent kit composition, storage access.
Toolsclient.toolsTool connections and live search/action operations.
Selfclient.selfAgent's own storage filesystem (API key only, no user token).

API Reference

Use the API Reference for direct clients in languages without an official SDK and for validating agent-generated integrations. The OpenAPI contract is published at openapi.yaml.

Factory Methods

peer

typescript
client.peer(name: string): PeerModule

Returns a PeerModule for read-only access to another agent's storage. Permission-gated by the target agent's /permissions node.

NameTypeRequiredDescription
namestringYesTarget agent's name (e.g., 'wealthbot').
typescript
const soul = await client.peer('wealthbot').read('/soul/soul.md');

Identity layer for AI agents