Skip to content

Commit 6325aa6

Browse files
committed
wip: websocket events, & other changes
1 parent 26d636b commit 6325aa6

File tree

11 files changed

+347
-66
lines changed

11 files changed

+347
-66
lines changed

eslint.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ export default configure({
66
"dist",
77
"src/generated",
88
"package.json",
9-
]
9+
],
10+
rules: {
11+
"node/prefer-global/process": "off"
12+
}
1013
});

example/src/automatic-sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const vrchat = new VRChat({
99
contact: "timmy@examaple.com"
1010
},
1111
authentication: {
12-
optimistic: false,
12+
// optimistic: false,
1313
credentials: () => prompts([
1414
{
1515
name: "username",

example/src/websocket.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import KeyvFile from "keyv-file";
2+
import prompts from "prompts";
3+
import { VRChat } from "vrchat";
4+
5+
const vrchat = new VRChat({
6+
application: {
7+
name: "Example",
8+
version: "1.5.1",
9+
contact: "timmy@examaple.com"
10+
},
11+
authentication: {
12+
// optimistic: false,
13+
credentials: () => prompts([
14+
{
15+
name: "username",
16+
type: "text",
17+
message: "VRChat username",
18+
},
19+
{
20+
name: "password",
21+
type: "password",
22+
message: "VRChat password",
23+
},
24+
{
25+
name: "twoFactorCode",
26+
type: "text",
27+
message: "Two-factor authentication code",
28+
}
29+
]),
30+
},
31+
keyv: new KeyvFile({ filename: "./data.json" }),
32+
});
33+

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,22 @@
3434
"author": "",
3535
"license": "MIT",
3636
"dependencies": {
37-
"@hey-api/client-fetch": "^0.13.0",
3837
"cacheable": "^1.10.0",
3938
"debug": "^4.4.1",
39+
"isomorphic-ws": "^5.0.0",
4040
"keyv": "^5.3.4",
41-
"totp-generator": "^1.0.0"
41+
"totp-generator": "^1.0.0",
42+
"ws": "^8.18.3"
4243
},
4344
"devDependencies": {
4445
"@ariesclark/eslint-config": "^3.1.1",
46+
"@hey-api/client-fetch": "^0.13.0",
4547
"@hey-api/openapi-ts": "^0.72.1",
4648
"@types/debug": "^4.1.12",
4749
"@types/node": "^24.0.3",
4850
"eslint": "^9.29.0",
4951
"tsup": "^8.5.0",
52+
"typed-emitter": "^2.1.0",
5053
"typescript": "^5.8.3"
5154
}
5255
}

pnpm-lock.yaml

Lines changed: 78 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)