Skip to content

Commit 0479ce2

Browse files
authored
Merge pull request #5 from commt/update-initiate-func
Update Initiate Function
2 parents 2accf3a + c44ea3c commit 0479ce2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/service/index.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ import { RoomProps } from "../context/reducers/roomsReducer";
55
import PackageJson from "../../package.json";
66
import * as events from "../utils/events";
77

8-
export interface InitiateProps {
8+
interface AuthKeyProps {
99
apiKey: string;
1010
subscriptionKey: string;
1111
projectName: string;
1212
}
1313

14-
interface OnlineInfoProps extends InitiateProps {
14+
export interface InitiateProps extends AuthKeyProps {
15+
projectName: string;
16+
}
17+
18+
interface OnlineInfoProps extends AuthKeyProps {
1519
userIds: string;
1620
chatAuthId: string; // for selfUser's chatAuthId
1721
}
@@ -21,7 +25,7 @@ type OnlineInfoReturnProps = Pick<
2125
"chatAuthId" | "socketId" | "online"
2226
>;
2327

24-
interface ReadTokenProps extends InitiateProps {
28+
interface ReadTokenProps extends AuthKeyProps {
2529
roomIds: string;
2630
chatAuthId: string; //selfUser's chatAuthId
2731
}
@@ -41,7 +45,7 @@ interface HandleLoggerProps extends InitiateProps {
4145
}
4246

4347
const project = {
44-
name: "React Native SDK",
48+
SDK: "React Native SDK",
4549
version: PackageJson.version,
4650
};
4751

@@ -52,8 +56,9 @@ export const initiate = async (props: InitiateProps) => {
5256
const response = await axios.get<ConfigsProps>(`/api/v1/tenant/config/`, {
5357
params: {
5458
plugin: true, // This is for backend compatibility
55-
project: project.name, // This is for backend compatibility & analytics
59+
SDK: project.SDK, // This is for backend compatibility & analytics
5660
version: project.version, // This is for backend compatibility & analytics
61+
name: projectName, // This is for backend compatibility & analytics
5762
},
5863
headers: {
5964
apiKey,

0 commit comments

Comments
 (0)