Permissions API (Draft WIP) - lolmaxz/vrc-ts GitHub Wiki

Permissions API Documentation

The Permissions API allows you to retrieve information about the permissions granted to your VRChat account. Permissions are typically assigned through actions such as subscribing to VRChat Plus (VRC+). This API provides methods to list all your assigned permissions and to get details about a specific permission.


Index

  1. getAssignedPermissions - Retrieve all permissions currently granted to your account.
  2. getPermission - Retrieve details about a specific permission.

Endpoints

1. getAssignedPermissions

Retrieve all permissions currently granted to your account.

Purpose

Returns a list of all permissions currently granted to your user. Permissions are assigned through various means, such as subscribing to VRC+.

Method Signature

getAssignedPermissions(): Promise<Permission[]>

Parameters

  • No parameters

Returns

  • Promise<Permission[]>: A promise that resolves to an array of Permission objects representing the permissions assigned to your account.

Example Usage

// Example: Retrieve all assigned permissions
const permissions = await vrchatApi.permissionsApi.getAssignedPermissions();
console.log(permissions);

2. getPermission

Retrieve details about a specific permission.

Purpose

Returns details about a specific permission by its permission ID. Note that this endpoint returns the same information as getAssignedPermissions, but for a single permission.

Method Signature

getPermission(options: {
  permissionId: string;
}): Promise<Permission>

Parameters

  • options (object):

    • permissionId (string, required):
      The ID of the permission to retrieve.

Returns

  • Promise<Permission>: A promise that resolves to a Permission object containing details about the specified permission.

Example Usage

// Example: Retrieve details about a specific permission
const permission = await vrchatApi.permissionsApi.getPermission({
  permissionId: 'perm_abcdef12-3456-7890-abcd-ef1234567890',
});
console.log(permission);

Additional Types

Permission Object Structure

type Permission = {
  id: string; // PermissionIdType
  ownerId: string; // UserIdType
  ownerDisplayName?: string;
  name: string;
  displayName?: string;
  type?: string;
  data?: {
    maxFavoritesPerGroup?: {
      avatar?: number;
    };
    maxFavoriteGroups?: {
      avatar?: number;
    };
    tags: string[];
  };
};

Endpoints:

  1. getAssignedPermissions - Retrieve all permissions currently granted to your account.
  2. getPermission - Retrieve details about a specific permission.

⚠️ **GitHub.com Fallback** ⚠️