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
| Name | Type | Required | Description |
|---|---|---|---|
apiKeyOrOptions | string | ConfigureClientOptions | No | Your Configure API key (sk_... or pk_...), or an options object. Falls back to CONFIGURE_API_KEY env var. |
options | ConfigureClientOptions | No | Client configuration options (only when first argument is a string). |
Options
| Name | Type | Default | Description |
|---|---|---|---|
baseUrl | string | https://api.configure.dev | API base URL. Also reads from CONFIGURE_BASE_URL env var. |
timeout | number | undefined | Request timeout in milliseconds. |
fetch | typeof fetch | globalThis.fetch | Custom 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.
| Module | Property | Description |
|---|---|---|
| Auth | client.auth | OTP authentication (send/verify). |
| Profile | client.profile | User profile CRUD, memories, ingestion, agent kit composition, storage access. |
| Tools | client.tools | Tool connections and live search/action operations. |
| Self | client.self | Agent's own storage filesystem (API key only, no user token). |
Factory Methods
peer
typescript
client.peer(name: string): PeerModuleReturns a PeerModule for read-only access to another agent's storage. Permission-gated by the target agent's /permissions node.
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Target agent's name (e.g., 'wealthbot'). |
typescript
const soul = await client.peer('wealthbot').read('/soul/soul.md');