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

# Preparing API Extensions for Shared Context

Kibo can run an API Extensions bundle in a **shared (warm) context**. Instead of loading a fresh copy of your compiled bundle for every request, the platform loads the bundle once per tenant and reuses that same loaded copy for later requests — including requests from other shoppers, other sessions, and other sites on the tenant. This cuts the CPU and time each action spends loading modules and rebuilding state on every request, and it matters most for high-traffic actions such as storefront and catalog.

## Why an audit comes first

Shared context changes what your code can safely assume. Between requests, the platform resets only what it can see from outside your modules — globals and `process.env`. It does **not** reset module-level variables, closures, the contents of objects, or properties added to `process`, `module`, or `console`. Code written for a fresh context on every request can leak shopper or request data into a later request, or keep work running past the point where the platform considers the request finished. See [Calling External APIs Safely](https://docs.kibocommerce.com/pages/programming-patterns.md#calling-external-apis-safely) and [Avoiding Unhandled Promise Rejections](https://docs.kibocommerce.com/pages/programming-patterns.md#avoiding-unhandled-promise-rejections) for related patterns that this audit also checks for.

Before turning on shared context for any manifest, audit the app for these patterns and fix what needs fixing.

## Run the audit

The audit prompt lives on its own page: [Arc.js Shared-Context Audit Prompt](https://docs.kibocommerce.com/pages/arcjs-shared-context-audit-prompt). Open it and copy everything on the page into an AI coding agent (Claude Code, Cursor, GitHub Copilot, or similar), then run it from the root of your Arc.js app repository — the folder containing `assets/functions.json` and `assets/src/`. The agent reads your source, produces a report (saved to `ARCJS-AUDIT.md`) with a verdict for each source manifest (`READY`, `MUST CHANGE`, `KEEP FRESH`, `NOTHING WIRED`, or `NOT AUDITED`), then asks which changes you want to apply and makes only the ones you approve. It does not upload or deploy anything.

Without an agent, use the same page as a manual checklist.

Once a manifest is `READY`, the prompt walks through declaring `"contextReuse": "warm"` for that manifest in `kibo.json` at the project root, next to `Gruntfile.js`.

To fetch the prompt as plain Markdown instead of opening it in a browser — for example to pipe it straight into an agent from the command line — append `.md` to the page URL:

```
https://docs.kibocommerce.com/pages/arcjs-shared-context-audit-prompt.md
```

## Related reading

* [Arc.js Shared-Context Audit Prompt](https://docs.kibocommerce.com/pages/arcjs-shared-context-audit-prompt) — the full audit prompt, as plain Markdown.
* [Programming Patterns](https://docs.kibocommerce.com/pages/programming-patterns.md) — execution time limits, outbound call timeouts, and the promise/callback patterns this audit checks for.
* [The Structure of an API Extension Application](https://docs.kibocommerce.com/pages/the-structure-of-an-api-extension-application.md) — where `kibo.json` sits relative to `Gruntfile.js`, `functions.json`, and the rest of the project.
* [Action Management JSON Editor](https://docs.kibocommerce.com/pages/action-management-json-editor.md) — per-action settings such as `timeoutMilliseconds` that also affect how long a shared context stays occupied.


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