Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b8475d9
websocket support (v1, in testing)
binn Nov 26, 2025
e4ca43c
improvements to websocket API
binn Nov 27, 2025
dbc0a0f
updates to websocket PR
binn Nov 28, 2025
a42da20
make some core changes and introduce xmldoc to realtime wrapper, upda…
binn Dec 4, 2025
36b5f3b
update docs
binn Dec 4, 2025
2522c46
final touch ups
binn Dec 4, 2025
a361a14
update CI with new package
binn Dec 4, 2025
14595da
remove claude code stuff
binn Dec 4, 2025
c2821b4
fix readme
binn Dec 5, 2025
9b6bc82
CI changes for new spec release
binn Dec 5, 2025
93d83a7
testt
binn Dec 5, 2025
2250204
ci fixes
binn Dec 5, 2025
b0267c6
another fix to ci
binn Dec 5, 2025
fc80593
try one more time
binn Dec 5, 2025
aa3f168
test
binn Dec 5, 2025
218d36c
fix wget
binn Dec 5, 2025
eab9a2f
Upgrade .NET SDK to spec 2.20.7-nightly
binn Dec 5, 2025
feb5aad
fix ci versioning
binn Dec 5, 2025
03115cf
Merge branch 'main' of https://github.com/binn/vrchatapi-csharp
binn Dec 5, 2025
466bd7f
Upgrade .NET SDK to spec 21.20.7-nightly.3
binn Dec 5, 2025
8997d77
remove quotes to fix versioning
binn Dec 5, 2025
2aaacd6
Merge branch 'main' of https://github.com/binn/vrchatapi-csharp
binn Dec 5, 2025
c7784f6
thanks AI
binn Dec 5, 2025
cd0a6fb
Upgrade .NET SDK to spec 220.7-nightly.3
binn Dec 5, 2025
ccc89d9
fix one last time my friend
binn Dec 5, 2025
f1a33d1
Merge branch 'main' of https://github.com/binn/vrchatapi-csharp
binn Dec 5, 2025
8c67db9
Upgrade .NET SDK to spec 2.20.7-nightly.3
binn Dec 5, 2025
242a9f6
CI auto version bump, yay
binn Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
68 changes: 37 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
on:
repository_dispatch:
types: [spec_release]
types: [release]
workflow_dispatch:

#on: push
inputs:
json:
description: 'Passed json from repository_dispatch'
required: true
type: string
version_postfix:
description: 'Additional string to concatenate onto the existing version before release'
required: false
type: string
default: ''

name: Generate VRChat API SDK

jobs:
generate:
runs-on: ubuntu-latest
name: Generate VRChat API SDK
env:
ARTIFACT_NAME: "openapi.yaml"
INPUT: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload || inputs.json }}
SPEC_URL: ${{ fromJSON(github.event_name == 'repository_dispatch' && github.event.client_payload || inputs.json)['artifacts']['openapi.yaml'] }}
PASSED_VERSION: ${{ fromJSON(github.event_name == 'repository_dispatch' && github.event.client_payload || inputs.json)['version'] }}
VERSION_POSTPEND: ${{ github.event_name == 'workflow_dispatch' && inputs.version_postfix || '' }}
steps:
- name: Install yq via apt
run: sudo apt install -y yq

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22

- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Cache node_modules'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-v18-${{ hashFiles('**/generate.sh') }}
key: ${{ runner.os }}-node-v22-${{ hashFiles('**/generate.sh') }}
restore-keys: |
${{ runner.os }}-node-v18
${{ runner.os }}-node-v22

- name: Install OpenAPI Generator CLI
run: npm install @openapitools/openapi-generator-cli
Expand All @@ -37,32 +48,27 @@ jobs:
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.1.1

- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'

- name: Generate SDK Client
run: bash ./generate.sh

- name: Copy README.md into src/
run: cp README.md src/
- name: Download Specification
run: wget "${SPEC_URL}" '--output-document' "${ARTIFACT_NAME}"

- name: Check version number
run: |
vrchat_sdk_version=$(yq '.info.version' openapi.yaml | tr -d '"')

major=$(echo $vrchat_sdk_version | cut -d. -f1)
minor=$(echo $vrchat_sdk_version | cut -d. -f2)
patch=$(echo $vrchat_sdk_version | cut -d. -f3)

vrchat_sdk_version="$((major+1)).$minor.$patch"
vrchat_sdk_version=$(( ${PASSED_VERSION%%.*} + 1)).${PASSED_VERSION#*.}${VERSION_POSTPEND}
echo "Version is: ${vrchat_sdk_version}"
echo "vrchat_sdk_version=$vrchat_sdk_version" >> $GITHUB_ENV

- name: Print version number
run: echo ${{ env.vrchat_sdk_version }}
- name: Generate SDK Client
run: bash ./generate.sh "${ARTIFACT_NAME}" "${vrchat_sdk_version}"

- name: Copy README.md into src/
run: cp README.md src/

- name: Delete openapi.yaml file
run: rm openapi.yaml
- name: Delete openapi.json file
run: unlink ${ARTIFACT_NAME}

- name: Deploy SDK back into main branch
uses: JamesIves/github-pages-deploy-action@v4
Expand All @@ -72,7 +78,7 @@ jobs:
commit-message: "Upgrade .NET SDK to spec ${{ env.vrchat_sdk_version }}"

- name: Publish to VRChat.API to NuGet
if: github.event_name != 'workflow_dispatch'
if: github.event_name == 'repository_dispatch'
uses: pairbit/publish-nuget@v2.5.8
with:
# Filepath of the project to be packaged, relative to root of repository
Expand All @@ -87,7 +93,7 @@ jobs:
INCLUDE_SYMBOLS: true

- name: Publish to VRChat.API.Extensions.Hosting to NuGet
if: github.event_name != 'workflow_dispatch'
if: github.event_name == 'repository_dispatch'
uses: pairbit/publish-nuget@v2.5.8
with:
# Filepath of the project to be packaged, relative to root of repository
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/realtime-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build and Publish VRChat Realtime SDK

on:
push:
branches:
- main
paths:
- 'wrapper/VRChat.API.Realtime/**'
- '.github/workflows/realtime-ci.yml'
workflow_dispatch:

jobs:
build-and-publish:
runs-on: ubuntu-latest
name: Build and Publish VRChat Realtime SDK
steps:
- name: Checkout current commit
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history to compare versions

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'

- name: Setup NuGet
uses: NuGet/setup-nuget@v1.1.1

- name: Get current version from csproj
id: current_version
run: |
VERSION=$(grep -oP '(?<=<Version>)[^<]+' wrapper/VRChat.API.Realtime/VRChat.API.Realtime.csproj)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Current version: $VERSION"

- name: Get previous version from NuGet
id: nuget_version
run: |
# Try to get the latest version from NuGet
NUGET_VERSION=$(curl -s "https://api.nuget.org/v3-flatcontainer/vrchat.api.realtime/index.json" | jq -r '.versions[-1]' 2>/dev/null || echo "0.0.0")
if [ "$NUGET_VERSION" = "null" ] || [ -z "$NUGET_VERSION" ]; then
NUGET_VERSION="0.0.0"
fi
echo "version=$NUGET_VERSION" >> $GITHUB_OUTPUT
echo "Latest NuGet version: $NUGET_VERSION"

- name: Check if version changed
id: version_check
run: |
CURRENT="${{ steps.current_version.outputs.version }}"
NUGET="${{ steps.nuget_version.outputs.version }}"

echo "Current version: $CURRENT"
echo "NuGet version: $NUGET"

if [ "$CURRENT" != "$NUGET" ]; then
echo "Version changed from $NUGET to $CURRENT"
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "Version unchanged ($CURRENT)"
echo "changed=false" >> $GITHUB_OUTPUT
fi

- name: Build project
run: dotnet build wrapper/VRChat.API.Realtime/VRChat.API.Realtime.csproj --configuration Release

- name: Publish to NuGet
if: steps.version_check.outputs.changed == 'true'
uses: pairbit/publish-nuget@v2.5.8
with:
PROJECT_FILE_PATH: wrapper/VRChat.API.Realtime/VRChat.API.Realtime.csproj
PACKAGE_NAME: VRChat.API.Realtime
NUGET_KEY: ${{ secrets.NUGET_KEY }}
INCLUDE_SYMBOLS: true
30 changes: 26 additions & 4 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ docs/AvatarsApi.md
docs/Badge.md
docs/Balance.md
docs/BanGroupMemberRequest.md
docs/BoopRequest.md
docs/CalendarApi.md
docs/CalendarEvent.md
docs/CalendarEventDiscovery.md
docs/CalendarEventDiscoveryInclusion.md
docs/CalendarEventDiscoveryScope.md
docs/CalendarEventUserInterest.md
docs/ChangeUserTagsRequest.md
docs/CreateAvatarModerationRequest.md
Expand All @@ -61,7 +65,6 @@ docs/CreateGroupPostRequest.md
docs/CreateGroupRequest.md
docs/CreateGroupRoleRequest.md
docs/CreateInstanceRequest.md
docs/CreatePermissionRequest.md
docs/CreateWorldRequest.md
docs/CurrentUser.md
docs/CurrentUserPlatformHistoryInner.md
Expand All @@ -72,6 +75,7 @@ docs/DiscordDetails.md
docs/DynamicContentRow.md
docs/EconomyAccount.md
docs/EconomyApi.md
docs/EquipInventoryItemRequest.md
docs/Error.md
docs/Favorite.md
docs/FavoriteGroup.md
Expand Down Expand Up @@ -137,6 +141,7 @@ docs/InstanceType.md
docs/InstancesApi.md
docs/Inventory.md
docs/InventoryApi.md
docs/InventoryConsumptionResults.md
docs/InventoryDefaultAttributesValue.md
docs/InventoryDefaultAttributesValueValidator.md
docs/InventoryDrop.md
Expand Down Expand Up @@ -171,6 +176,8 @@ docs/LimitedWorld.md
docs/MIMEType.md
docs/MiscellaneousApi.md
docs/ModerateUserRequest.md
docs/MutualFriend.md
docs/Mutuals.md
docs/Notification.md
docs/NotificationDetailInvite.md
docs/NotificationDetailInviteResponse.md
Expand All @@ -182,6 +189,7 @@ docs/NotificationsApi.md
docs/OkStatus.md
docs/OkStatus2.md
docs/OrderOption.md
docs/OrderOptionShort.md
docs/PaginatedCalendarEventList.md
docs/PaginatedGroupAuditLogEntryList.md
docs/PastDisplayName.md
Expand All @@ -200,10 +208,13 @@ docs/Product.md
docs/ProductListing.md
docs/ProductListingType.md
docs/ProductListingVariant.md
docs/ProductPurchase.md
docs/ProductPurchasePurchaseContext.md
docs/ProductType.md
docs/Prop.md
docs/PropUnityPackage.md
docs/PropsApi.md
docs/PurchaseProductListingRequest.md
docs/Region.md
docs/RegisterUserAccountRequest.md
docs/ReleaseStatus.md
Expand All @@ -218,6 +229,7 @@ docs/ServiceQueueStats.md
docs/ServiceStatus.md
docs/ShareInventoryItemDirectRequest.md
docs/SortOption.md
docs/SortOptionProductPurchase.md
docs/Store.md
docs/StoreShelf.md
docs/StoreType.md
Expand Down Expand Up @@ -250,7 +262,6 @@ docs/UpdateGroupRequest.md
docs/UpdateGroupRoleRequest.md
docs/UpdateInventoryItemRequest.md
docs/UpdateInviteMessageRequest.md
docs/UpdatePermissionRequest.md
docs/UpdateTiliaTOSRequest.md
docs/UpdateUserBadgeRequest.md
docs/UpdateUserNoteRequest.md
Expand Down Expand Up @@ -353,7 +364,11 @@ src/VRChat.API/Model/AvatarUnityPackageUrlObject.cs
src/VRChat.API/Model/Badge.cs
src/VRChat.API/Model/Balance.cs
src/VRChat.API/Model/BanGroupMemberRequest.cs
src/VRChat.API/Model/BoopRequest.cs
src/VRChat.API/Model/CalendarEvent.cs
src/VRChat.API/Model/CalendarEventDiscovery.cs
src/VRChat.API/Model/CalendarEventDiscoveryInclusion.cs
src/VRChat.API/Model/CalendarEventDiscoveryScope.cs
src/VRChat.API/Model/CalendarEventUserInterest.cs
src/VRChat.API/Model/ChangeUserTagsRequest.cs
src/VRChat.API/Model/CreateAvatarModerationRequest.cs
Expand All @@ -368,7 +383,6 @@ src/VRChat.API/Model/CreateGroupPostRequest.cs
src/VRChat.API/Model/CreateGroupRequest.cs
src/VRChat.API/Model/CreateGroupRoleRequest.cs
src/VRChat.API/Model/CreateInstanceRequest.cs
src/VRChat.API/Model/CreatePermissionRequest.cs
src/VRChat.API/Model/CreateWorldRequest.cs
src/VRChat.API/Model/CurrentUser.cs
src/VRChat.API/Model/CurrentUserPlatformHistoryInner.cs
Expand All @@ -378,6 +392,7 @@ src/VRChat.API/Model/Disable2FAResult.cs
src/VRChat.API/Model/DiscordDetails.cs
src/VRChat.API/Model/DynamicContentRow.cs
src/VRChat.API/Model/EconomyAccount.cs
src/VRChat.API/Model/EquipInventoryItemRequest.cs
src/VRChat.API/Model/Error.cs
src/VRChat.API/Model/Favorite.cs
src/VRChat.API/Model/FavoriteGroup.cs
Expand Down Expand Up @@ -437,6 +452,7 @@ src/VRChat.API/Model/InstanceRegion.cs
src/VRChat.API/Model/InstanceShortNameResponse.cs
src/VRChat.API/Model/InstanceType.cs
src/VRChat.API/Model/Inventory.cs
src/VRChat.API/Model/InventoryConsumptionResults.cs
src/VRChat.API/Model/InventoryDefaultAttributesValue.cs
src/VRChat.API/Model/InventoryDefaultAttributesValueValidator.cs
src/VRChat.API/Model/InventoryDrop.cs
Expand Down Expand Up @@ -468,6 +484,8 @@ src/VRChat.API/Model/LimitedUserSearch.cs
src/VRChat.API/Model/LimitedWorld.cs
src/VRChat.API/Model/MIMEType.cs
src/VRChat.API/Model/ModerateUserRequest.cs
src/VRChat.API/Model/MutualFriend.cs
src/VRChat.API/Model/Mutuals.cs
src/VRChat.API/Model/Notification.cs
src/VRChat.API/Model/NotificationDetailInvite.cs
src/VRChat.API/Model/NotificationDetailInviteResponse.cs
Expand All @@ -478,6 +496,7 @@ src/VRChat.API/Model/NotificationType.cs
src/VRChat.API/Model/OkStatus.cs
src/VRChat.API/Model/OkStatus2.cs
src/VRChat.API/Model/OrderOption.cs
src/VRChat.API/Model/OrderOptionShort.cs
src/VRChat.API/Model/PaginatedCalendarEventList.cs
src/VRChat.API/Model/PaginatedGroupAuditLogEntryList.cs
src/VRChat.API/Model/PastDisplayName.cs
Expand All @@ -494,9 +513,12 @@ src/VRChat.API/Model/Product.cs
src/VRChat.API/Model/ProductListing.cs
src/VRChat.API/Model/ProductListingType.cs
src/VRChat.API/Model/ProductListingVariant.cs
src/VRChat.API/Model/ProductPurchase.cs
src/VRChat.API/Model/ProductPurchasePurchaseContext.cs
src/VRChat.API/Model/ProductType.cs
src/VRChat.API/Model/Prop.cs
src/VRChat.API/Model/PropUnityPackage.cs
src/VRChat.API/Model/PurchaseProductListingRequest.cs
src/VRChat.API/Model/Region.cs
src/VRChat.API/Model/RegisterUserAccountRequest.cs
src/VRChat.API/Model/ReleaseStatus.cs
Expand All @@ -511,6 +533,7 @@ src/VRChat.API/Model/ServiceQueueStats.cs
src/VRChat.API/Model/ServiceStatus.cs
src/VRChat.API/Model/ShareInventoryItemDirectRequest.cs
src/VRChat.API/Model/SortOption.cs
src/VRChat.API/Model/SortOptionProductPurchase.cs
src/VRChat.API/Model/Store.cs
src/VRChat.API/Model/StoreShelf.cs
src/VRChat.API/Model/StoreType.cs
Expand Down Expand Up @@ -543,7 +566,6 @@ src/VRChat.API/Model/UpdateGroupRequest.cs
src/VRChat.API/Model/UpdateGroupRoleRequest.cs
src/VRChat.API/Model/UpdateInventoryItemRequest.cs
src/VRChat.API/Model/UpdateInviteMessageRequest.cs
src/VRChat.API/Model/UpdatePermissionRequest.cs
src/VRChat.API/Model/UpdateTiliaTOSRequest.cs
src/VRChat.API/Model/UpdateUserBadgeRequest.cs
src/VRChat.API/Model/UpdateUserNoteRequest.cs
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,16 @@ public class MyController : Controller

Console app (login): see [VRChat.API.Examples.Console](examples/VRChat.API.Examples.Console/)

Console app (WebSocket): see [VRChat.API.Examples.WebSocket](examples/VRChat.API.Examples.WebSocket/)

ASP.NET Core (depedency injection): see [VRChat.API.Examples.AspNetCore](examples/VRChat.API.Examples.AspNetCore/)

# WebSockets / VRChat Pipeline

You can use the `VRChat.API.Realtime` library to connect to VRChat's WebSocket and listen to events.

The documentation for it is available at [WEBSOCKET.md](WEBSOCKET.md).

# Manually authenticating

Sometimes, we don't have two-factor authentication set up on our accounts. While it's **reccomended** for most bots or apps, your app may be a WPF/WinForms application that requires user credential input. In these cases, the `LoginAsync()` methods on `IVRChat` won't work, because they only support token-based two-factor authentication.
Expand Down
Loading