# Integrate with your agent

Give your agent the official instructions to integrate Longplay and verify the result.

Last updated: 2026-11-06

[Web version](https://www.longplayai.com/docs/guides/agents)

<a id="skill"></a>

## Install the official skill

Run this command in your project root, then select your agent to install the project-level Longplay skill. Requires Node.js 22.20 or later.

**terminal**

```bash
npx skills@1.7.4 add https://www.longplayai.com/skills/longplay/SKILL.md
```

After installation, invoke `longplay` in your skill-enabled agent and describe the capabilities you need. The skill guides the agent through the official docs, project inspection and integration. You still provide accounts, authorization and business configuration.

- [Download SKILL.md manually](https://www.longplayai.com/skills/longplay/SKILL.md)

<a id="start"></a>

## Start with your task

Give this guide and your integration requirements to your coding agent. The agent inspects your stack and existing authentication, selects an SDK or HTTP API, checks prerequisites and implements the code. You provide account access, authorization and business decisions.

- Existing project: preserve its authentication, routing, build and coding conventions.
- No business goal selected yet: start with Customer identity, an entitlement check and usage reporting.
- Enable capabilities as needed. SDK coverage differs by language; installation does not establish payment or business readiness.

- [Platform and capability support](https://www.longplayai.com/docs/guides/platforms.md)
- [Minimal integration](https://www.longplayai.com/docs/quickstart.md)
- [IAM builds and visual binding](https://www.longplayai.com/docs/iam.md)

<a id="versions"></a>

## Resolve stable and lock dependencies

Install the latest stable release, then commit exact versions and lockfiles. These examples use protocol 0.10; CLI 0.3.23 is versioned independently. The API origin must still support a matching protocol. Check the platform and capability support table before integrating to confirm that the operations you need are available.

- [Platform installation](https://www.longplayai.com/docs/install.md)
- [Protocol and version support](https://www.longplayai.com/docs/guides/version-support.md)

<a id="scope"></a>

## Confirm scope, identity and permissions

**Deployment entry points**

| Deployment | Console / CLI | SDK / HTTP |
| --- | --- | --- |
| Production | https://console.longplayai.com | https://api.longplayai.com |

- Sandbox/Live is business scope inside the same deployment; choosing sandbox does not change the API address. App, environment, credentials and resource IDs must match.
- Start on the backend. Keep the Server Key there; browsers and native apps receive a Customer Token issued after your backend authenticates the user.
- Use the returned expiresAt and renew the session according to the deployed protocol; it cannot outlive the issuing Key. Handle revocation and logout too.
- Management and publication use user-approved CLI delegation; an SDK Server Key grants no Console management authority.

- [Environments](https://www.longplayai.com/docs/guides/environments.md)
- [Create a Server Key](https://www.longplayai.com/docs/guides/server-auth.md)
- [Customer identity](https://www.longplayai.com/docs/guides/customers.md)

<a id="tasks"></a>

## Choose a task guide

**Integrate by business goal**

| Goal | Prepare | Successful result |
| --- | --- | --- |
| Customers, access and usage | A metered Feature, a free default Product including it, and a minimally scoped Key. | Stable Customer identity, check.allowed true and usage receipt.accepted true. |
| Offering / Paywall | Create and save Products, publish an Offering Version, then publish a Paywall pinned to that version; configure payments when purchases are needed. | Resolve the correct version, display choices and confirm outcomes from commercial operations and entitlements. |
| Features, experiments and events | Published definitions, Customer identity and required collection settings in the same App/environment. | Explainable evaluations and completed event delivery; query statistical results separately once sufficient data exists. |

- [Minimal integration](https://www.longplayai.com/docs/quickstart.md)
- [Offering / Paywall](https://www.longplayai.com/docs/guides/commerce.md)
- [Experiments and events](https://www.longplayai.com/docs/guides/features.md)
- [Offers and rewards](https://www.longplayai.com/docs/guides/offers.md)
- [Funnel](https://www.longplayai.com/docs/guides/funnels.md)
- [Notifications and callbacks](https://www.longplayai.com/docs/guides/notifications.md)

<a id="management"></a>

## Use the CLI for resource configuration

Discover capability and permission dependencies before guiding the user through sign-in and exact-scope approval. Create only the needed resources; publication and payments retain their permissions and business prerequisites.

**terminal**

```bash
npm install -g @tinkerlandai/longplay-cli@0.3.23
longplay capabilities --json
longplay operations list --available --json
longplay operations describe console.customers.post --json
```

- [CLI sign-in and authorization](https://www.longplayai.com/docs/cli.md)

<a id="verify"></a>

## Verify and recover

- Run the project's relevant type, contract and offline tests first. These verify code and request shapes, not real payment or business success.
- Real calls need a configured and authorized target. Check response scope, business state and receipts instead of HTTP 200 alone.
- After a timeout, keep the original requestId, eventId or idempotency key and read the original operation. Do not blindly retry with new IDs. Resolve missing permissions or choose supported capabilities after 501.
- Explain code changes, checks run, missing configuration and unverified results in the conversation. Deployment, real charges, browser verification and data deletion follow the user's authorization.

- [Errors and recovery](https://www.longplayai.com/docs/api/errors.md)
- [Testing](https://www.longplayai.com/docs/guides/testing.md)
