Skip to content

You are currently viewing documentation for0.1.0-beta.1

Wrap Pipedream client.proxy

When to use this

Use this guide when your agent already reaches a vendor through Pipedream client.proxy and you want the embedded Node SDK to inspect that HTTP boundary. Prefer it after the quickstart has wrapped one owned API read. For transport choice (embedded SDK vs HTTP host vs MCP vs playground), use the chooser instead.

How to wrap client.proxy

Illustrative offline fixture for Node 22+ with published agindow@0.1.0-beta.1. Wrap client.proxy with clientAdapter. The embedded SDK needs no separate AGINDOW API key; keep vendor credentials in the Pipedream client. The sample replaces fetch with a local response so it never leaves the process. Wrapping a container does not discover nested clients.

ts
import { PipedreamClient } from '@pipedream/sdk';
import { createAgindow } from 'agindow';
const sdk = createAgindow();
await sdk.ready;
// Offline transport fixture. This token is synthetic and never leaves the process.
const originalFetch = globalThis.fetch;
globalThis.fetch = async () => new Response('{"ok":true}', { headers: { 'content-type': 'application/json' } });
try {
  const client = new PipedreamClient({ projectId: 'fixture', tokenProvider: { getToken: async () => 'offline-fixture' } });
  const proxy = sdk.clientAdapter(client.proxy, { tool: 'slack.chat', operation: 'write' });
  console.log(await proxy.post({ externalUserId: 'fixture', accountId: 'fixture', url: 'https://slack.com/api/chat.postMessage', body: { text: 'fixture' } }));
} finally {
  globalThis.fetch = originalFetch;
}

What to expect

Observe mode preserves original payloads, results and upstream exceptions. Statistical detection requires an explicit selection with comparable baseline/live JSON windows; without it the SDK does not learn or refresh a baseline. An empty recent() history is not a clean verdict. Selective repair stays off by default and needs reviewed rename rules plus independent verification. Python remains callable-only for this platform.

Reference

Use the Node guide for full call wrapping and configuration for detector selection. The public Pipedream page summarizes surface limits without replacing this how-to.

To issue a scoped API key, open the dashboard, select your organization and environment, then go to Settings → API Keys.