# GET /v1/projects/:projectId/sdk-apps/:appId/install-spec (/docs/api/reference/sdk-apps/install-spec)



<Endpoint method="GET" path="/v1/projects/:projectId/sdk-apps/:appId/install-spec" auth="Bearer" scope="projects:read" phase="1" />

Returns the exact dependency line, environment variables, init snippet, and any files your user should create to install the Layers SDK by hand. This is the same information the GitHub ingest flow uses to generate its PR — you can read it to render a "copy-paste install" UI when the user isn't using the Git-based flow.

The spec is deterministic: same SDK app + same requested platforms always produces the same snippet, so you can diff it against what the user has in-repo and detect drift. Platforms the SDK app was created for are returned by default; pass `?platforms=` to restrict.

<Parameters
  title="Path"
  rows="[
  { name: 'projectId', type: 'string', required: true, description: 'Project ID.' },
  { name: 'appId', type: 'string', required: true, description: 'SDK app ID.' },
]"
/>

<Parameters
  title="Query"
  rows="[
  { name: 'platforms', type: 'string', description: 'Comma-separated list of platforms to return specs for. Defaults to all platforms the SDK app was created for.', enum: ['ios', 'android', 'web', 'react-native', 'flutter', 'expo'] },
]"
/>

## Example request [#example-request]

<Tabs items="['curl', 'TypeScript', 'Python']">
  <Tab value="curl">
    ```bash
    curl "https://api.layers.com/v1/projects/9cb958b5-11b5-4e30-8675-5d075d52da7c/sdk-apps/app_8ffb9410eb0eb848264f8a65/install-spec?platforms=ios" \
      -H "Authorization: Bearer lp_live_01HX9Y6K7EJ4T2_4QZpN..."
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    const spec = await layers.sdkApps.installSpec(
      "9cb958b5-11b5-4e30-8675-5d075d52da7c",
      "app_8ffb9410eb0eb848264f8a65",
      { platforms: ["ios"] }
    );
    ```
  </Tab>

  <Tab value="Python">
    ```python
    spec = layers.sdk_apps.install_spec(
        project_id="9cb958b5-11b5-4e30-8675-5d075d52da7c",
        app_id="app_8ffb9410eb0eb848264f8a65",
        platforms=["ios"],
    )
    ```
  </Tab>
</Tabs>

## Response [#response]

<Response status="200" description="OK">
  ```json
  {
    "appId": "app_8ffb9410eb0eb848264f8a65",
    "platforms": [
      {
        "platform": "ios",
        "dependency": {
          "manager": "spm",
          "url": "https://github.com/layers-os/layers-sdk-ios",
          "from": "1.4.0"
        },
        "envVars": [
          { "name": "LAYERS_APP_ID", "value": "app_8ffb9410eb0eb848264f8a65" },
          { "name": "LAYERS_INGEST_ENDPOINT", "value": "https://in.layers.com/l/events" }
        ],
        "initSnippet": "import Layers\n\nLayers.configure(\n  appId: \"app_8ffb9410eb0eb848264f8a65\",\n  endpoint: URL(string: \"https://in.layers.com/l/events\")!\n)"
      }
    ]
  }
  ```

  `dependency.manager` values: `spm`, `cocoapods`, `gradle`, `maven`, `npm`, `yarn`, `pnpm`, `pub`, `expo`. SPM and CocoaPods entries carry `url` + `from`; Gradle/npm/Pub/Expo entries carry `version`. `filesToCreate` is omitted when no boilerplate files are needed (current iOS, Android, web, react-native, flutter, expo specs).
</Response>

## Errors [#errors]

| Status | Code              | When                                                            |
| ------ | ----------------- | --------------------------------------------------------------- |
| 422    | `VALIDATION`      | `:projectId` is not a UUID, or unknown platform in `platforms`. |
| 401    | `UNAUTHENTICATED` | Missing or invalid key.                                         |
| 403    | `FORBIDDEN_SCOPE` | Key lacks `projects:read`.                                      |
| 404    | `NOT_FOUND`       | Project or SDK app does not exist.                              |
| 429    | `RATE_LIMITED`    | Read budget exhausted.                                          |

## See also [#see-also]

* [`POST /v1/projects/:id/ingest/github`](/docs/api/reference/github/ingest-github) — automated install via PR
* [`POST /v1/projects/:projectId/sdk-apps`](/docs/api/reference/sdk-apps/create-sdk-app) — provision an SDK app
