@@ -7,8 +7,7 @@ import * as events from "../utils/events";
77
88export interface InitiateProps {
99 apiKey : string ;
10- subscriptionKey : string ;
11- projectName : string ;
10+ projectId : string ;
1211}
1312
1413interface OnlineInfoProps extends InitiateProps {
@@ -46,19 +45,17 @@ const project = {
4645} ;
4746
4847export const initiate = async ( props : InitiateProps ) => {
49- const { apiKey, subscriptionKey , projectName } = props ;
48+ const { apiKey, projectId } = props ;
5049
5150 try {
52- const response = await axios . get < ConfigsProps > ( `/api/v1/tenant /config/` , {
51+ const response = await axios . get < ConfigsProps > ( `/api/v1/project /config/` , {
5352 params : {
54- plugin : true , // This is for backend compatibility
5553 SDK : project . SDK , // This is for backend compatibility & analytics
5654 version : project . version , // This is for backend compatibility & analytics
57- name : projectName , // This is for backend compatibility & analytics
55+ projectId , // This is for backend compatibility & analytics
5856 } ,
5957 headers : {
6058 apiKey,
61- subscriptionKey,
6259 } ,
6360 } ) ;
6461
@@ -71,8 +68,7 @@ export const initiate = async (props: InitiateProps) => {
7168 // Log error to service
7269 handleLogger ( {
7370 apiKey,
74- subscriptionKey,
75- projectName,
71+ projectId,
7672 error : {
7773 error,
7874 event : events . INITIATE_TENANT_CONFIGS ,
@@ -82,7 +78,7 @@ export const initiate = async (props: InitiateProps) => {
8278} ;
8379
8480export const getUsersOnlineInfo = async ( props : OnlineInfoProps ) => {
85- const { userIds, apiKey, subscriptionKey , projectName , chatAuthId } = props ;
81+ const { userIds, apiKey, projectId , chatAuthId } = props ;
8682
8783 try {
8884 const response = await axios . get < OnlineInfoReturnProps [ ] > (
@@ -93,7 +89,6 @@ export const getUsersOnlineInfo = async (props: OnlineInfoProps) => {
9389 } ,
9490 headers : {
9591 apiKey,
96- subscriptionKey,
9792 } ,
9893 } ,
9994 ) ;
@@ -103,8 +98,7 @@ export const getUsersOnlineInfo = async (props: OnlineInfoProps) => {
10398 // Log error to service
10499 handleLogger ( {
105100 apiKey,
106- subscriptionKey,
107- projectName,
101+ projectId,
108102 error : {
109103 error,
110104 event : events . GET_USERS_ONLINE_INFO ,
@@ -115,7 +109,7 @@ export const getUsersOnlineInfo = async (props: OnlineInfoProps) => {
115109} ;
116110
117111export const getRoomsReadToken = async ( props : ReadTokenProps ) => {
118- const { roomIds, apiKey, subscriptionKey , projectName , chatAuthId } = props ;
112+ const { roomIds, apiKey, projectId , chatAuthId } = props ;
119113
120114 try {
121115 const response = await axios . get < ReadTokenReturnProps [ ] > (
@@ -126,7 +120,6 @@ export const getRoomsReadToken = async (props: ReadTokenProps) => {
126120 } ,
127121 headers : {
128122 apiKey,
129- subscriptionKey,
130123 } ,
131124 } ,
132125 ) ;
@@ -135,8 +128,7 @@ export const getRoomsReadToken = async (props: ReadTokenProps) => {
135128 // TODO: Log error
136129 handleLogger ( {
137130 apiKey,
138- subscriptionKey,
139- projectName,
131+ projectId,
140132 error : {
141133 error,
142134 event : events . GET_ROOMS_READ_TOKEN ,
@@ -147,17 +139,10 @@ export const getRoomsReadToken = async (props: ReadTokenProps) => {
147139} ;
148140
149141export const handleLogger = async ( props : HandleLoggerProps ) => {
150- const {
151- apiKey,
152- subscriptionKey,
153- projectName,
154- error,
155- chatAuthId,
156- chatRoomAuthId,
157- } = props ;
142+ const { apiKey, projectId, error, chatAuthId, chatRoomAuthId } = props ;
158143
159144 const logObject = {
160- projectName ,
145+ projectId ,
161146 SDK : project . SDK ,
162147 version : project . version ,
163148 error,
@@ -169,7 +154,6 @@ export const handleLogger = async (props: HandleLoggerProps) => {
169154 axios . post ( "/system/logger" , logObject , {
170155 headers : {
171156 apiKey,
172- subscriptionKey,
173157 } ,
174158 } ) ;
175159 } catch ( error_ ) {
0 commit comments