VipEntitlementCheckResult vip.entitlement-check-result@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
vip
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/vip/entitlement-check-result.v1.json

vip.entitlement-check-result@1: the answer of vip.entitlement.check on OpenVibe.VIP. GET or POST /api/v1/entitlements/check → an entitlement answer (vip.entitlement@1); unknown never authorizes. With product it adds { product, product_perks, preferences }: the perks of the member's plan version that have bindings for that product (none unless active), and the member's badge and listing preferences for the creator.

Fields

This schema has no named fields.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: plain
{
  "member": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "kind": "channel_subscription",
  "status": "unknown",
  "active": false,
  "expires_at": null,
  "cancel_at_period_end": false,
  "source": "none",
  "stale": false,
  "valid_until": null,
  "checked_at": "2026-09-25T09:12:40.118Z",
  "reason": "billing_unavailable",
  "membership": null
}
Valid: product
{
  "member": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "kind": "channel_subscription",
  "status": "active",
  "active": true,
  "expires_at": "2026-10-20T18:04:11.000Z",
  "cancel_at_period_end": false,
  "source": "projection",
  "stale": false,
  "valid_until": "2026-09-25T09:17:40.118Z",
  "checked_at": "2026-09-25T09:12:40.118Z",
  "membership": {
    "id": "vms_01JAB2C3D4E5F6G7H8J9K0MNPX",
    "member": {
      "type": "user",
      "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
    },
    "creator_id": "vcr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "plan_id": "vpl_01JAB2C3D4E5F6G7H8J9K0MNPW",
    "plan_version": {
      "id": "vpv_01JAB2C3D4E5F6G7H8J9K0MNPT",
      "version": 2,
      "name": "Supporter",
      "terms": {
        "name": "Supporter",
        "description": "Back the stream every month.",
        "benefits": [
          "Supporter badge in chat",
          "Members-only VOD chapters"
        ],
        "perks": [
          {
            "key": "chat-badge",
            "name": "Chat badge",
            "kind": "badge",
            "scope": "creator"
          }
        ],
        "billing_kind": "channel_subscription",
        "price": "set and charged by OpenVibe.Billing",
        "digest": "3fa9c0d27e5b8814"
      }
    },
    "perks": [
      "chat-badge"
    ],
    "origin": "checkout",
    "joined_at": "2026-09-20T18:04:11.402Z",
    "terms_since": "2026-09-20T18:04:11.402Z"
  },
  "product": "chat",
  "product_perks": [
    {
      "key": "chat-badge",
      "name": "Chat badge",
      "kind": "badge",
      "scope": "creator",
      "bindings": [
        {
          "binding": "chat_badge",
          "config": {
            "icon": "star"
          }
        }
      ]
    }
  ],
  "preferences": {
    "show_badge": true,
    "listed": false
  }
}
Rejected: no-active
{
  "member": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "kind": "channel_subscription",
  "status": "active",
  "expires_at": "2026-10-20T18:04:11.000Z",
  "cancel_at_period_end": false,
  "source": "projection",
  "stale": false,
  "valid_until": "2026-09-25T09:17:40.118Z",
  "checked_at": "2026-09-25T09:12:40.118Z",
  "membership": {
    "id": "vms_01JAB2C3D4E5F6G7H8J9K0MNPX",
    "member": {
      "type": "user",
      "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
    },
    "creator_id": "vcr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "plan_id": "vpl_01JAB2C3D4E5F6G7H8J9K0MNPW",
    "plan_version": {
      "id": "vpv_01JAB2C3D4E5F6G7H8J9K0MNPT",
      "version": 2,
      "name": "Supporter",
      "terms": {
        "name": "Supporter",
        "description": "Back the stream every month.",
        "benefits": [
          "Supporter badge in chat",
          "Members-only VOD chapters"
        ],
        "perks": [
          {
            "key": "chat-badge",
            "name": "Chat badge",
            "kind": "badge",
            "scope": "creator"
          }
        ],
        "billing_kind": "channel_subscription",
        "price": "set and charged by OpenVibe.Billing",
        "digest": "3fa9c0d27e5b8814"
      }
    },
    "perks": [
      "chat-badge"
    ],
    "origin": "checkout",
    "joined_at": "2026-09-20T18:04:11.402Z",
    "terms_since": "2026-09-20T18:04:11.402Z"
  },
  "product": "chat"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('vip.entitlement-check-result@1', value);   // { valid, errors: [{ path, message }] }