Skip to content

You are currently viewing documentation for0.1.0-alpha.4

Saved documentation for 0.1.0-alpha.4 (npm) / 0.1.0a3 (PyPI). Interactive tools use the current release. View latest documentation.

Wrap Nango proxy and sandbox codegen

When to use this

Use this guide when your Node runtime can install npm and you want Surface A clientAdapter around Nango HTTP proxy methods, or when a Nango sandbox forbids npm and you need the CLI report/codegen path instead. Auth and storage helpers such as batchSave and checkpoints never enter drift evaluation.

How to wrap the proxy

Illustrative excerpt for Node 22+ with published agindow@0.1.0-alpha.4. Surface A wraps HTTP proxy methods with clientAdapter where npm is allowed. triggerAction is not an HTTP allow-list method; guard it explicitly if you need action output. For sandboxes that forbid npm, use the CLI report and limited codegen path instead of installing WASM inside the sandbox. Generated code has not been tested in a deployed Nango sandbox.

ts
import { Nango } from '@nangohq/node';
import { createAgindow } from 'agindow';
const sdk = createAgindow({ mode: 'observe' });
await sdk.ready;
const client = new Nango({ secretKey: process.env.NANGO_SECRET_KEY ?? '' });
const proxy = sdk.clientAdapter(client, {
  tool: (request: { endpoint: string }) => `nango/${request.endpoint}`,
});

What to expect

Observe mode preserves original payloads, results and upstream exceptions. Installing and wrapping alone does not configure detection: the statistical guest is default; configure windows to detect. 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 CLI guide for no-npm sandboxes and the Node guide when npm is allowed. The public Nango page summarizes surface limits without replacing this how-to.