Skip to content

ConfigureClient

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

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
baseUrlstringhttps://api.configure.devAPI base URL. Also reads from CONFIGURE_BASE_URL env var.
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',
  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).

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 and memory infrastructure for AI agents