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

System API Documentation

The System API provides various system-level information and configurations used by the VRChat client and API consumers. This includes fetching API configurations, getting the current online user count, and retrieving the current system time.


Index

  1. fetchAPIConfig - Retrieve the API configuration.
  2. currentOnlineUsers - Get the current number of online users.
  3. currentSystemTime - Get the current system time of the API server.
  4. showInformationNotices - [Under Development] Show information notices.
  5. downloadCSS - [Under Development] Download the frontend CSS.
  6. downloadJavaScript - [Under Development] Download the frontend JavaScript.
  7. checkAPIHealth - [Deprecated] Check the API health.

Endpoints

1. fetchAPIConfig

Retrieve the API configuration.

Purpose

Fetch the API configuration required for clients to function properly. This includes important values such as the clientApiKey, which is used for other API endpoints.

Method Signature

fetchAPIConfig(): Promise<APIConfig>

Parameters

  • No parameters

Returns

  • Promise<APIConfig>: A promise that resolves to an APIConfig object containing the API configuration details.

Example Usage

// Example: Fetch the API configuration
const apiConfig = await vrchatApi.systemApi.fetchAPIConfig();
console.log(apiConfig.clientApiKey);

2. currentOnlineUsers

Get the current number of online users.

Purpose

Retrieve the current number of users online in VRChat. This is a simple method that returns an integer representing the online user count.

Method Signature

currentOnlineUsers(): Promise<number>

Parameters

  • No parameters

Returns

  • Promise<number>: A promise that resolves to a number representing the current online user count.

Example Usage

// Example: Get the current number of online users
const onlineUserCount = await vrchatApi.systemApi.currentOnlineUsers();
console.log(`Current online users: ${onlineUserCount}`);

3. currentSystemTime

Get the current system time of the API server.

Purpose

Retrieve the current system time from the API server. This can be used to synchronize time-sensitive operations with the server's time.

Method Signature

currentSystemTime(): Promise<string>

Parameters

  • No parameters

Returns

  • Promise<string>: A promise that resolves to a string representing the current system time in ISO 8601 format.

Example Usage

// Example: Get the current system time from the API server
const systemTime = await vrchatApi.systemApi.currentSystemTime();
console.log(`Current system time: ${systemTime}`);

4. showInformationNotices

**[Under Development]** Show information notices.

Purpose

Status: Early Access (Still Under Development)

The Information Push System (IPS) is used by VRChat to push dynamic information to the client. This is primarily used for quick-menu info banners and alerts, such as notifying users to update to the latest version.

Method Signature

showInformationNotices(): void

Parameters

  • No parameters

Note

This endpoint is still under development and may not be available. Please check back later for updates.


5. downloadCSS

**[Under Development]** Download the frontend CSS.

Purpose

Fetches the CSS code for the VRChat frontend React website.

Method Signature

downloadCSS(): void

Parameters

  • No parameters

Note

This endpoint is still under development and may not be available. Please check back later for updates.


6. downloadJavaScript

**[Under Development]** Download the frontend JavaScript.

Purpose

Fetches the JavaScript code for the VRChat frontend React website.

Method Signature

downloadJavaScript(): void

Parameters

  • No parameters

Note

This endpoint is still under development and may not be available. Please check back later for updates.


7. checkAPIHealth

**[Deprecated]** Check the API health.

Purpose

Deprecated: This endpoint is deprecated and will be removed in the future.

Retrieve the health status of the API. The response type is not a JSON object but a simple JSON integer.

Method Signature

checkAPIHealth(): void

Parameters

  • No parameters

Note

This endpoint is deprecated and may not function as expected. Please avoid using this endpoint.


Additional Types

APIConfig Object Structure

type APIConfig = {
  clientApiKey: string;
  appName: string;
  buildVersionTag: string;
  // ... other configuration properties
};

Note: The APIConfig object contains many properties, including clientApiKey, which is essential for API requests.


Endpoints:

  1. fetchAPIConfig - Retrieve the API configuration.
  2. currentOnlineUsers - Get the current number of online users.
  3. currentSystemTime - Get the current system time of the API server.
  4. showInformationNotices - [Under Development] Show information notices.
  5. downloadCSS - [Under Development] Download the frontend CSS.
  6. downloadJavaScript - [Under Development] Download the frontend JavaScript.
  7. checkAPIHealth - [Deprecated] Check the API health.

Notes

  • Under Development Endpoints: Some endpoints are still under development or not yet implemented. They may not be available or functional at this time.

  • Deprecated Endpoints: The checkAPIHealth endpoint is deprecated and should not be used.

  • APIConfig Usage: The clientApiKey from the APIConfig is crucial for making other API requests that require authentication.


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