Skip to content

Commit 362b6b5

Browse files
authored
feat!: remove server-side capabilities from JS client (#1282)
**BREAKING CHANGES** - The `StreamVideoServerClient` has been removed, integrators should use the [`@stream-io/node-sdk`](https://getstream.io/video/docs/api/#installation) for server-side integration - `role` field have been removed from `UserRequest` -> it didn't do anything, so integrators should just remove this from their code - `VideoEvent` renamed to `WSEvent` - `LayoutSettings` are removed from the client-side API, it's only available on server-side Internal notes for Stream developers: `HealthCheckEvent` and `CustomVideoEvent` models are missing from open API, they manually have to be added. `object` needs to be replaced with `{[key: string]: any}`
1 parent c9eb06f commit 362b6b5

File tree

23 files changed

+350
-1670
lines changed

23 files changed

+350
-1670
lines changed

packages/client/generate-openapi.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ else
99
PROTOCOL_REPO_DIR="../../../protocol"
1010
fi
1111
if [ "$FROM_REPO" == 'chat' ]; then
12-
SCHEMA_FILE="$PROTOCOL_REPO_DIR/releases/video-openapi.yaml"
13-
elif [ "$FROM_REPO" == 'protocol' ]; then
14-
SCHEMA_FILE="$PROTOCOL_REPO_DIR/openapi/video-openapi.yaml"
12+
SCHEMA_FILE="$PROTOCOL_REPO_DIR/releases/video-openapi-clientside.yaml"
1513
else
16-
SCHEMA_FILE=$FROM_REPO
14+
SCHEMA_FILE="$PROTOCOL_REPO_DIR/openapi/video-openapi-clientside.yaml"
1715
fi
1816

1917
if [ "$FROM_REPO" == 'chat' ]; then

packages/client/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export * from './src/stats/types';
1313
export * from './src/Call';
1414
export * from './src/CallType';
1515
export * from './src/StreamVideoClient';
16-
export * from './src/StreamVideoServerClient';
1716
export * from './src/StreamSfuClient';
1817
export * from './src/devices';
1918
export * from './src/store';

packages/client/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"axios": "^1.6.0",
3636
"base64-js": "^1.5.1",
3737
"isomorphic-ws": "^5.0.0",
38-
"jsonwebtoken": "^9.0.2",
3938
"rxjs": "~7.8.1",
4039
"sdp-transform": "^2.14.1",
4140
"ua-parser-js": "^1.0.36",
@@ -46,7 +45,7 @@
4645
"@openapitools/openapi-generator-cli": "^2.7.0",
4746
"@rollup/plugin-replace": "^5.0.5",
4847
"@rollup/plugin-typescript": "^11.1.6",
49-
"@types/jsonwebtoken": "^9.0.3",
48+
"@stream-io/node-sdk": "^0.1.12",
5049
"@types/sdp-transform": "^2.4.7",
5150
"@types/ua-parser-js": "^0.7.37",
5251
"@vitest/coverage-v8": "^0.34.4",

packages/client/rollup.config.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import replace from '@rollup/plugin-replace';
44
import pkg from './package.json' assert { type: 'json' };
55

66
// these modules are used only in nodejs and are not needed in the browser
7-
const browserIgnoredModules = [
8-
'jsonwebtoken',
9-
'https',
10-
'crypto',
11-
'util',
12-
'stream',
13-
];
7+
const browserIgnoredModules = ['https', 'util', 'stream'];
148

159
/**
1610
* A plugin which converts the nodejs modules to empty modules for the browser.

packages/client/src/StreamVideoServerClient.ts

Lines changed: 0 additions & 106 deletions
This file was deleted.

packages/client/src/__tests__/StreamVideoClient.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
22
import { StreamVideoClient } from '../StreamVideoClient';
33
import 'dotenv/config';
44
import { generateUUIDv4 } from '../coordinator/connection/utils';
5-
import { StreamVideoServerClient } from '../StreamVideoServerClient';
65
import { User } from '../coordinator/connection/types';
6+
import { StreamClient } from '@stream-io/node-sdk';
77

88
const apiKey = process.env.STREAM_API_KEY!;
99
const secret = process.env.STREAM_SECRET!;
1010

11+
const serverClient = new StreamClient(apiKey, secret);
12+
1113
const tokenProvider = (userId: string) => {
12-
const serverClient = new StreamVideoServerClient(apiKey, { secret });
1314
return async () => {
1415
return new Promise<string>((resolve) => {
1516
setTimeout(() => {
16-
const token = serverClient.createToken(userId);
17+
const token = serverClient.createToken(
18+
userId,
19+
undefined,
20+
Math.round(Date.now() / 1000 - 10),
21+
);
1722
resolve(token);
1823
}, 100);
1924
});

packages/client/src/__tests__/server-side/call-members.test.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)