VipMembership vip.membership@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/membership.v1.json

vip.membership@1: VIP's record of a membership (server/domain/memberships.js present): which plan version the member bought, the perk keys that version grants and how the membership was filed (checkout: the member's own VIP checkout; billing: a Billing subscription bought elsewhere; import). Whether it is active is never stored here: that is Billing's entitlement (vip.entitlement@1).

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^vms_[0-9A-HJKMNP-TV-Z]{26}$
memberidentity.subject-refyes
creator_idstringyes
  • pattern ^(vcr_[0-9A-HJKMNP-TV-Z]{26}|network)$
plan_idstring | nullyesnull when Billing granted a membership for a creator with no VIP plan.
plan_versionone ofyes
perksarray of stringyesPerk keys of the plan version.
originenumyes
  • one of "checkout", "billing", "import"
joined_atstringyes
  • format date-time
terms_sincestringyes
  • format date-time

Examples

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

Valid: checkout
{
  "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"
}
Valid: no-plan
{
  "id": "vms_01JAB2C3D4E5F6G7H8J9K0MNPX",
  "member": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "creator_id": "vcr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "plan_id": null,
  "plan_version": null,
  "perks": [],
  "origin": "billing",
  "joined_at": "2026-09-20T18:04:11.402Z",
  "terms_since": "2026-09-20T18:04:11.402Z"
}
Rejected: bad-origin
{
  "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": "gift",
  "joined_at": "2026-09-20T18:04:11.402Z",
  "terms_since": "2026-09-20T18:04:11.402Z"
}

Validate

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