Extensions

Docs API reference

Extensions

A workspace’s own widget blocks (spec 46): a small sandboxed web page with the capabilities it DECLARES — network origins, records, an upstream with a server-held secret, camera, microphone. A version is uploaded switched off; only a signed-in owner switches it on, after seeing that list (the activate, rollback, deactivate and secrets calls take the member session, never an API key). On screens a widget holds at most a five-minute token for its own extension.

List extension widgets

GET /extensions extensions

Responses

  • 200 The extensions.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
Response fields (200)
  • items object[] required
    5 fields in items
    • ext_id string
    • name string
    • active object or null

      { version, sha256, caps, activated_by, activated_at, previous }

    • active_words string[]
    • versions object[]
  • next_cursor string or null required

    Pass as cursor for the next page; null on the last page.

curl "https://www.wunderframe.com/api/v1/extensions" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY"
Response 200
{
  "items": [
    {
      "ext_id": "com.acme.door",
      "name": "Door",
      "active": null,
      "active_words": [],
      "versions": []
    }
  ],
  "next_cursor": null
}
Error example
Response 401
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}

Upload an extension version (switched off)

POST /extensions extensions

Upload JSON { manifest, entry, assets? }, multipart manifest + entry, or multipart package containing one ZIP (extension.json, entry.js, optional assets/). ZIP limits: 8 MiB packed, 16 MiB unpacked, 128 files. The code retains its 512 KiB limit. Assets are available offline through wf.asset(path).

Request body required

JSON, or the file itself as the body with one of multipart/form-data as its Content-Type.

  • manifest object required

    extension.json

  • entry string required

    entry.js, one bundled module ≤ 512 KB

  • assets object

    Optional assets/ paths to { mime, data: base64 }; 16 MiB total.

Responses

  • 201 The extension with the new version.
  • 400 The request is invalid — details.field names the field when there is one.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
  • 409 Conflicts with the current state.
  • 422 The submitted package or fields failed validation.
Response fields (201)
  • ext_id string
  • name string
  • active object or null

    { version, sha256, caps, activated_by, activated_at, previous }

  • active_words string[]
  • versions object[]
curl -X POST "https://www.wunderframe.com/api/v1/extensions" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "manifest": {
    "id": "com.acme.door",
    "version": "1.0.0",
    "engine": "^1",
    "name": "Door",
    "blocks": [],
    "capabilities": {}
  },
  "entry": "wf.ready();"
}'
Response 201
{
  "ext_id": "com.acme.door",
  "name": "Door",
  "active": null,
  "active_words": [],
  "versions": []
}
Error example
Response 400
{
  "error": {
    "code": "invalid",
    "message": "The request is invalid — `details.field` names the field when there is one."
  }
}

Switch a version on (owner, signed in)

POST /extensions/{id}/activate extensions

Parameters

  • id string required path

    The extension’s reverse-DNS id, e.g. com.acme.door.

Request body required

  • sha256 string

    The version to switch on.

    Pattern ^[0-9a-f]{64}$

  • ack string[]

    The capability keys the owner was shown (every one the version declares).

Responses

  • 200 The extension.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
  • 404 Not found in this workspace.
  • 409 Conflicts with the current state.
Response fields (200)
  • ext_id string
  • name string
  • active object or null

    { version, sha256, caps, activated_by, activated_at, previous }

  • active_words string[]
  • versions object[]
curl -X POST "https://www.wunderframe.com/api/v1/extensions/wkFRBzMq6POZ_qYJHvgQf/activate" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "ack": [
    "network:https://api.acme.com",
    "records"
  ]
}'
Response 200
{
  "ext_id": "com.acme.door",
  "name": "Door",
  "active": null,
  "active_words": [],
  "versions": []
}
Error example
Response 401
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}

Back to the version on before (owner, signed in)

POST /extensions/{id}/rollback extensions

Parameters

  • id string required path

    The extension’s reverse-DNS id, e.g. com.acme.door.

Request body required

  • sha256 string

    The version to switch on.

    Pattern ^[0-9a-f]{64}$

  • ack string[]

    The capability keys the owner was shown (every one the version declares).

Responses

  • 200 The extension.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
  • 404 Not found in this workspace.
  • 409 Conflicts with the current state.
Response fields (200)
  • ext_id string
  • name string
  • active object or null

    { version, sha256, caps, activated_by, activated_at, previous }

  • active_words string[]
  • versions object[]
curl -X POST "https://www.wunderframe.com/api/v1/extensions/wkFRBzMq6POZ_qYJHvgQf/rollback" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "ack": [
    "network:https://api.acme.com",
    "records"
  ]
}'
Response 200
{
  "ext_id": "com.acme.door",
  "name": "Door",
  "active": null,
  "active_words": [],
  "versions": []
}
Error example
Response 401
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}

Switch an extension off (owner, signed in)

POST /extensions/{id}/deactivate extensions

Parameters

  • id string required path

    The extension’s reverse-DNS id, e.g. com.acme.door.

Responses

  • 200 The extension.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
  • 404 Not found in this workspace.
Response fields (200)
  • ext_id string
  • name string
  • active object or null

    { version, sha256, caps, activated_by, activated_at, previous }

  • active_words string[]
  • versions object[]
curl -X POST "https://www.wunderframe.com/api/v1/extensions/wkFRBzMq6POZ_qYJHvgQf/deactivate" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY"
Response 200
{
  "ext_id": "com.acme.door",
  "name": "Door",
  "active": null,
  "active_words": [],
  "versions": []
}
Error example
Response 401
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}

Exchange a member session for a widget token (RFC 8693; signed in)

POST /extensions/token extensions

The member half of the token exchange (spec 46 §5.1): a signed-in member previewing a widget trades their session for a five-minute token for one extension at its active version (sub: user:<id>). A screen exchanges its own bearer at /api/player/ext/token instead. JSON only; an API key is never accepted.

Request body required

  • grant_type string required

    One of urn:ietf:params:oauth:grant-type:token-exchange

  • subject_token_type string
  • requested_token_type string

    One of urn:ietf:params:oauth:token-type:jwt

  • audience string required

    wf-ext:<extension id>

  • scope string

    Space-separated, a subset of what the extension declares; empty = all of it.

  • ext_sha256 string required
  • block_id string required

Responses

  • 200 The token.
  • 400 The request is invalid — details.field names the field when there is one.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
  • 415 Unsupported media type.
  • 429 Too many requests for this key: wait details.retry_after_s seconds (also in Retry-After).
Response fields (200)
  • access_token string
  • issued_token_type string
  • token_type string

    One of Bearer

  • expires_in integer
  • scope string
curl -X POST "https://www.wunderframe.com/api/v1/extensions/token" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
  "subject_token_type": "urn:ietf:params:oauth:token-type:access_token",
  "requested_token_type": "urn:ietf:params:oauth:token-type:jwt",
  "audience": "wf-ext:acme-bell",
  "scope": "records:read",
  "ext_sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "block_id": "blk_1"
}'
Response 200
{
  "access_token": "string",
  "issued_token_type": "string",
  "token_type": "Bearer",
  "expires_in": 0,
  "scope": "string"
}
Error example
Response 400
{
  "error": {
    "code": "invalid",
    "message": "The request is invalid — `details.field` names the field when there is one."
  }
}

Set an upstream secret (write-only; owner, signed in)

PUT /extensions/{id}/secrets/{name} extensions

Parameters

  • id string required path

    The extension’s reverse-DNS id, e.g. com.acme.door.

  • name string required path

    The secret’s name the manifest’s upstream names.

Request body required

  • value string required

Responses

  • 200 Its name and a hint, never the value.
  • 400 The request is invalid — details.field names the field when there is one.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
  • 404 Not found in this workspace.
  • 503 A service this call needs is not available right now.
Response fields (200)
  • name string
  • hint string
curl -X PUT "https://www.wunderframe.com/api/v1/extensions/wkFRBzMq6POZ_qYJHvgQf/secrets/string" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "value": "sk_live_…"
}'
Response 200
{
  "name": "string",
  "hint": "string"
}
Error example
Response 400
{
  "error": {
    "code": "invalid",
    "message": "The request is invalid — `details.field` names the field when there is one."
  }
}