System API (Draft WIP) - lolmaxz/vrc-ts GitHub Wiki
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.
-
fetchAPIConfig
- Retrieve the API configuration. -
currentOnlineUsers
- Get the current number of online users. -
currentSystemTime
- Get the current system time of the API server. -
showInformationNotices
- [Under Development] Show information notices. -
downloadCSS
- [Under Development] Download the frontend CSS. -
downloadJavaScript
- [Under Development] Download the frontend JavaScript. -
checkAPIHealth
- [Deprecated] Check the API health.
Retrieve the API configuration.
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.
fetchAPIConfig(): Promise<APIConfig>
- No parameters
-
Promise<APIConfig>
: A promise that resolves to anAPIConfig
object containing the API configuration details.
// Example: Fetch the API configuration
const apiConfig = await vrchatApi.systemApi.fetchAPIConfig();
console.log(apiConfig.clientApiKey);
Get the current number of online users.
Retrieve the current number of users online in VRChat. This is a simple method that returns an integer representing the online user count.
currentOnlineUsers(): Promise<number>
- No parameters
-
Promise<number>
: A promise that resolves to a number representing the current online user count.
// Example: Get the current number of online users
const onlineUserCount = await vrchatApi.systemApi.currentOnlineUsers();
console.log(`Current online users: ${onlineUserCount}`);
Get the current system time of the API server.
Retrieve the current system time from the API server. This can be used to synchronize time-sensitive operations with the server's time.
currentSystemTime(): Promise<string>
- No parameters
-
Promise<string>
: A promise that resolves to a string representing the current system time in ISO 8601 format.
// Example: Get the current system time from the API server
const systemTime = await vrchatApi.systemApi.currentSystemTime();
console.log(`Current system time: ${systemTime}`);
**[Under Development]** Show information notices.
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.
showInformationNotices(): void
- No parameters
This endpoint is still under development and may not be available. Please check back later for updates.
**[Under Development]** Download the frontend CSS.
Fetches the CSS code for the VRChat frontend React website.
downloadCSS(): void
- No parameters
This endpoint is still under development and may not be available. Please check back later for updates.
**[Under Development]** Download the frontend JavaScript.
Fetches the JavaScript code for the VRChat frontend React website.
downloadJavaScript(): void
- No parameters
This endpoint is still under development and may not be available. Please check back later for updates.
**[Deprecated]** Check the API health.
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.
checkAPIHealth(): void
- No parameters
This endpoint is deprecated and may not function as expected. Please avoid using this endpoint.
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.
-
fetchAPIConfig
- Retrieve the API configuration. -
currentOnlineUsers
- Get the current number of online users. -
currentSystemTime
- Get the current system time of the API server. -
showInformationNotices
- [Under Development] Show information notices. -
downloadCSS
- [Under Development] Download the frontend CSS. -
downloadJavaScript
- [Under Development] Download the frontend JavaScript. -
checkAPIHealth
- [Deprecated] Check the API health.
-
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 theAPIConfig
is crucial for making other API requests that require authentication.