-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
23 lines (20 loc) · 836 Bytes
/
Copy pathProgram.cs
File metadata and controls
23 lines (20 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using VRChat.API.Client;
namespace VRChat.API.UnitSample
{
// While it would be nice to use the new .NET 6 template, it seems reasonable enough
// to use the classic Program.Main here, for ease of understand (for the end-user).
public class Program
{
public static async Task Main(string[] args)
{
string username = Environment.GetEnvironmentVariable("VRCHAT_USERNAME");
string password = Environment.GetEnvironmentVariable("VRCHAT_PASSWORD");
var client = new VRChatClientBuilder()
.WithUsername(username)
.WithPassword(password)
.Build();
var user = await client.Authentication.GetCurrentUserAsync();
Console.WriteLine("Logged in as: {0} ({1})", user.Username, user.Id);
}
}
}