> ## Documentation Index
> Fetch the complete documentation index at: https://docs.impact.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade the JavaScript SDK

> Move older impact-ai applications to explicit startup and the current native client and request APIs.

The package name remains `impact-ai`. Update imports, startup and request boundaries when moving from the earlier API.

| Earlier surface | Current replacement |
| - | - |
| default or named `impact` object | `import * as impact from 'impact-ai'`. The current package exports functions and types and does not provide the old object alias. |
| `withImpactTraceContext` | Use `impact.context(value, operation)` for Product identity. Send W3C parentage and bounded Impact correlation with `impact.injectContext(carrier)`. On receipt, use `impact.context({ propagated: impact.extractContext(carrier) }, operation)`. Carrier values never grant Product tenancy. |
| `createInteraction`, `NoopInteractionController` | Use `impact.span(name, options, operation)` or a maintained automatic owner and remove controller lifecycle code. |
| CommonJS and Node.js 18 | The current package requires ESM and supports the Node.js 22.15+ and 24 release lines. Initialize once with `await impact.init()` before constructing supported clients. Follow the integration's import-order requirements. |
| old endpoint configuration | Direct OTLP uses the explicit OTLP endpoint and ingest key. On deployments that offer Product discovery, use the application API origin and discovery key. |
| old score/interaction metadata | Use `impact.feedback(...)` for native feedback and `impact.context(...)` for validated correlation fields. |
| mark/protect behavior | Use explicit `runtime.activateProtect(...)` for the selected learned-policy runtime. It does not restore the generic `mark` API. |

Use ESM and the supported Node release lines. If you use the historical Google client or LlamaIndex, check the
current [integration catalogue](https://docs.impact.ai/sdk/javascript/integrations.md) before moving the application.

## Migrate from the OpenAI Assistants API

Move the application to `client.responses.create`, carry forward its instructions and tool definitions, and
choose how to manage conversation state. Check the tool calls, output items and stream events your application
actually consumes. For Microsoft Foundry, use the standard OpenAI client with the resource's `/openai/v1/`
base URL and the deployment name. Check the selected capture boundaries. [Integration catalogue](https://docs.impact.ai/sdk/javascript/integrations.md#openai).
[OpenAI migration guide](https://developers.openai.com/api/docs/assistants/migration) ·
[Microsoft Foundry v1 API](https://learn.microsoft.com/en-us/azure/foundry/openai/api-version-lifecycle)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.