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

# Install

> Where to start the SDK in each runtime, what Manifest covers, and how to check an install.

## Where to start

<Tabs>
  <Tab title="Python" id="python" icon="https://mintcdn.com/manifest-selfhealing/9Fx9YUdkmXypAXXe/images/stacks/python.svg?fit=max&auto=format&n=9Fx9YUdkmXypAXXe&q=85&s=4576dbb049be33fddf08fd3d245a2e2a" width="110" height="110" data-path="images/stacks/python.svg">
    Put `mnfst run` in front of the command that starts your app. The SDK then
    starts before any of your code, with no `manifest()` call.

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    mnfst run uvicorn main:app
    ```
  </Tab>

  <Tab title="Node" id="node" icon="https://mintcdn.com/manifest-selfhealing/9Fx9YUdkmXypAXXe/images/stacks/nodejs.svg?fit=max&auto=format&n=9Fx9YUdkmXypAXXe&q=85&s=e28f261532dda55204fbd77e8273a5e5" width="800" height="800" data-path="images/stacks/nodejs.svg">
    Preload the SDK when a library creates its HTTP client before your
    `manifest()` call:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    node -r manifest/register app.js
    ```

    When you cannot change the `node` command, set the preload in `NODE_OPTIONS`:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    NODE_OPTIONS="--require manifest/register" nest start
    ```

    ### Next.js

    Add this function to `src/instrumentation.ts`. On Next.js 14, also set
    `experimental.instrumentationHook: true` in `next.config.js`.

    ```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
    // src/instrumentation.ts
    export async function register() {
      if (process.env.NEXT_RUNTIME === 'nodejs') {
        const { manifest } = await import('manifest');
        manifest();
      }
    }
    ```
  </Tab>

  <Tab title="PHP" id="php" icon="https://mintcdn.com/manifest-selfhealing/9Fx9YUdkmXypAXXe/images/stacks/php.svg?fit=max&auto=format&n=9Fx9YUdkmXypAXXe&q=85&s=0df6f6d11dff52e977db8a02ea6c214e" width="128" height="128" data-path="images/stacks/php.svg">
    ### Laravel

    Call `manifest()` from a service provider, and add the entry to
    `config/services.php`:

    ```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
    // app/Providers/AppServiceProvider.php
    public function register(): void
    {
        \Mnfst\manifest(config('services.manifest.key'), config('services.manifest.url'));
    }
    ```

    ```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
    // config/services.php
    'manifest' => ['key' => env('MNFST_KEY'), 'url' => env('MNFST_URL')],
    ```
  </Tab>
</Tabs>

## What Manifest covers

Manifest heals a [recoverable request](/glossary#recoverable-request) with a
JSON or form body up to 256 KiB. The SDK records every other request without
healing it.

In Python, the SDK sees `httpx`, `httpx2` and `requests`.

In Node, the SDK sees the global `fetch` and the `http` and `https` modules,
so it sees Axios too.

In PHP, the SDK sees the Laravel `Http` facade, Guzzle, Symfony `HttpClient`,
CakePHP and WordPress. It records a library with its own raw `curl_*` client
but never heals it.

The PHP SDK needs the `opentelemetry` extension, so it cannot run on shared
hosting. Laravel Vapor and Bref need a Lambda layer that includes the
extension. Without a writable temporary folder on the server, the SDK stops
recording but keeps healing.

In Hermes, the plugin sees tool calls to MCP servers reached over HTTP. A
failed tool call shows the status `418` in the dashboard. This code stands
for a failed tool call, never for a real API answer.

The SDK retries a patched request once. A retry can repeat a side effect of
the first request, so send an idempotency key when the API accepts one.

A script that exits with `process.exit()`, `os._exit()` or a signal can lose
its last requests, so let it end on its own. A PHP worker such as Laravel
Octane or `queue:work` sends its requests only when it restarts.

## Check your install

Each `doctor` command checks the install and the key. Run it in the folder
and the environment of your app:

<Tabs>
  <Tab title="Python" id="python" icon="https://mintcdn.com/manifest-selfhealing/9Fx9YUdkmXypAXXe/images/stacks/python.svg?fit=max&auto=format&n=9Fx9YUdkmXypAXXe&q=85&s=4576dbb049be33fddf08fd3d245a2e2a" width="110" height="110" data-path="images/stacks/python.svg">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    mnfst run mnfst doctor
    ```
  </Tab>

  <Tab title="Node" id="node" icon="https://mintcdn.com/manifest-selfhealing/9Fx9YUdkmXypAXXe/images/stacks/nodejs.svg?fit=max&auto=format&n=9Fx9YUdkmXypAXXe&q=85&s=e28f261532dda55204fbd77e8273a5e5" width="800" height="800" data-path="images/stacks/nodejs.svg">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    npx manifest doctor
    ```
  </Tab>

  <Tab title="PHP" id="php" icon="https://mintcdn.com/manifest-selfhealing/9Fx9YUdkmXypAXXe/images/stacks/php.svg?fit=max&auto=format&n=9Fx9YUdkmXypAXXe&q=85&s=0df6f6d11dff52e977db8a02ea6c214e" width="128" height="128" data-path="images/stacks/php.svg">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    vendor/bin/manifest doctor
    ```
  </Tab>
</Tabs>

Outside Next.js, the Node command warns "Loads before your app" when your
app calls `manifest()`. Check the setup screen instead.

When the setup screen shows "Waiting for your first request", check that:

* `MNFST_KEY` is set where the app runs
* the app restarted after you set it
* Manifest starts before the first API request
* in PHP, the `opentelemetry` extension is active.

When the setup screen shows "Connected. Waiting for a failing request", the
install works. To open the dashboard now, send a JSON request that your API
rejects with `400`, `404` or `422`.
