Skip to content
Longplay
Docs
Browse docs / Integrate with your agent

Integrate with your agent

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

Markdown
API v1Updated

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.

terminalShell
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.

Related: Download SKILL.md manually

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.

Related: Platform and capability support·Minimal integration·IAM builds and visual binding

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.

Related: Platform installation·Protocol and version support

Confirm scope, identity and permissions#

Deployment entry points
DeploymentConsole / CLISDK / HTTP
Productionhttps://console.longplayai.comhttps://api.longplayai.com

Deployment entry points

  • Production

    Console / CLI
    https://console.longplayai.com
    SDK / HTTP
    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.

Related: Environments·Create a Server Key·Customer identity

Choose a task guide#

Integrate by business goal
GoalPrepareSuccessful result
Customers, access and usageA 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 / PaywallCreate 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 eventsPublished 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.

Integrate by business goal

  • Customers, access and usage

    Prepare
    A metered Feature, a free default Product including it, and a minimally scoped Key.
    Successful result
    Stable Customer identity, check.allowed true and usage receipt.accepted true.
  • Offering / Paywall

    Prepare
    Create and save Products, publish an Offering Version, then publish a Paywall pinned to that version; configure payments when purchases are needed.
    Successful result
    Resolve the correct version, display choices and confirm outcomes from commercial operations and entitlements.
  • Features, experiments and events

    Prepare
    Published definitions, Customer identity and required collection settings in the same App/environment.
    Successful result
    Explainable evaluations and completed event delivery; query statistical results separately once sufficient data exists.

Related: Minimal integration·Offering / Paywall·Experiments and events·Offers and rewards·Funnel·Notifications and callbacks

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.

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

Related: CLI sign-in and authorization

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.

Related: Errors and recovery·Testing