deploy.hosting.detect-nextjs

Check whether a repository branch is a Next.js app the platform can build and serve on pooled hosting

GET /deploy/api/nextjs/detectIAM git:PullRepositoryReadSensitive read, audited

Reads package.json and the lockfiles at the branch (a read of source, recorded like a clone). next 15 or newer builds; older is too-old; no next is not-nextjs.

Request syntax

GET /deploy/api/nextjs/detect

Query parameters

  • repositoryIdRequired

    string

    The repository to look at

  • branchOptional

    string

    The branch; default the repository’s default branch

    Constraints: 1-255 chars

  • rootDirOptional

    string

    Folder of the app in the repository; default the root (.)

    Constraints: max 255 chars, /^[A-Za-z0-9._/-]*$/

Response

200 with `data`: kind, and for nextjs and too-old the version, major and packageManager; otherwise a reason. 404 when the repository or the branch does not exist.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Fields of data

  • kindAlways

    one of nextjs, too-old, not-nextjs, no-package-json

    nextjs: builds; too-old: Next below 15; not-nextjs or no-package-json: deploy it as a container
  • versionWhen present

    string

    The next dependency as written in package.json
  • majorWhen present

    number, may be null

    Its major version; null for a tag such as latest
  • packageManagerWhen present

    one of npm, pnpm, yarn, bun

    What the build installs with, from the lockfile
  • reasonWhen present

    string

    Why it is not a Next.js app
  • commitAlways

    string

    The commit read
  • branchAlways

    string

    The branch read

Checked against the handlers: every route test validates their answers against this schema.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow git:PullRepository on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud deploy hosting detect-nextjs --repository-id example

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_deploy_hosting_detect-nextjs.