Agent Install Guide

Use this page to let coding agents install GIGA comments on tenant blog templates safely.

1. Create Agent Token (Dashboard Auth Required)

Endpoint: POST /api/tenant/sites/:siteId/agent-tokens

curl -sS -X POST https://giga.mobile/api/tenant/sites/<SITE_ID>/agent-tokens \
  -H 'content-type: application/json' \
  -H 'cookie: gf_tenant_session=<TENANT_SESSION_COOKIE>' \
  --data '{"label":"CI agent","scopes":["embed:install","embed:validate"],"expires_in_days":90}'

Response includes one-time token value token.value. Store it securely.

2. Get Install Snippet (Agent Token)

Endpoint: POST /api/agent/embed/install

curl -sS -X POST https://giga.mobile/api/agent/embed/install \
  -H 'content-type: application/json' \
  -H 'authorization: Bearer <AGENT_TOKEN>' \
  --data '{"site_id":"<SITE_ID>","domain":"example.com","route_pattern":"/blog/:slug","theme":"auto"}'

Use returned snippet near end of <body>, before </footer> or </body>.

3. Validate Integration (Agent Token)

Endpoint: POST /api/agent/embed/validate

curl -sS -X POST https://giga.mobile/api/agent/embed/validate \
  -H 'content-type: application/json' \
  -H 'authorization: Bearer <AGENT_TOKEN>' \
  --data '{"site_id":"<SITE_ID>","page_id":"/blog/my-post","page_url":"https://example.com/blog/my-post","requested_features":["sort","comment-vote"]}'

Read checks; integration is complete when valid=true.

Contracts

Embed runtime contract: snippets load /embed.js, which calls POST /api/embed/bootstrap and then loads /embed/frame?ctx=....

OpenAPI spec: /openapi-agent.json

Main AI page: /ai