MCPcopy Create free account
hub / github.com/GetStream/stream-js / StreamClient

Class StreamClient

src/client.ts:158–1105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156 * @class StreamClient
157 */
158export class StreamClient<StreamFeedGenerics extends DefaultGenerics = DefaultGenerics> {
159 baseUrl: string;
160 baseAnalyticsUrl: string;
161 apiKey: string;
162 appId?: string;
163 usingApiSecret: boolean;
164 apiSecret: string | null;
165 userToken: string | null;
166 enrichByDefault: boolean;
167 options: ClientOptions;
168 userId?: string;
169 authPayload?: unknown;
170 version: string;
171 fayeUrl: string;
172 group: string;
173 expireTokens: boolean;
174 location: string;
175 fayeClient: Faye.Client<RealTimeMessage<StreamFeedGenerics>> | null;
176 browser: boolean;
177 node: boolean;
178 nodeOptions?: { httpAgent: http.Agent; httpsAgent: https.Agent };
179
180 request: axios.AxiosInstance;
181 subscriptions: Record<
182 string,
183 { fayeSubscription: Faye.Subscription | Promise<Faye.Subscription>; token: string; userId: string }
184 >;
185 handlers: Record<string, HandlerCallback>;
186
187 currentUser?: StreamUser<StreamFeedGenerics>;
188 personalization: Personalization<StreamFeedGenerics>;
189 collections: Collections<StreamFeedGenerics>;
190 files: StreamFileStore;
191 images: StreamImageStore;
192 reactions: StreamReaction<StreamFeedGenerics>;
193 auditLogs: StreamAuditLogs<StreamFeedGenerics>;
194
195 private _personalizationToken?: string;
196 private _collectionsToken?: string;
197 private _getOrCreateToken?: string;
198
199 addToMany?: <StreamFeedGenerics extends DefaultGenerics = DefaultGenerics>( // eslint-disable-line no-shadow
200 this: StreamClient, // eslint-disable-line no-use-before-define
201 activity: StreamFeedGenerics['activityType'],
202 feeds: string[],
203 ) => Promise<APIResponse>; // eslint-disable-line no-use-before-define
204 followMany?: (this: StreamClient, follows: FollowRelation[], activityCopyLimit?: number) => Promise<APIResponse>; // eslint-disable-line no-use-before-define
205 unfollowMany?: (this: StreamClient, unfollows: UnfollowRelation[]) => Promise<APIResponse>; // eslint-disable-line no-use-before-define
206 createRedirectUrl?: (this: StreamClient, targetUrl: string, userId: string, events: unknown[]) => string; // eslint-disable-line no-use-before-define
207 addUsers?: (this: StreamClient, users: StreamUser[], overrideExisting: boolean) => Promise<AddUsersResponse>; // eslint-disable-line no-use-before-define
208 getUsers?: (this: StreamClient, ids: string[]) => Promise<GetUsersResponse>; // eslint-disable-line no-use-before-define
209 deleteUsers?: (this: StreamClient, ids: string[]) => Promise<string[]>; // eslint-disable-line no-use-before-define
210 deleteActivities?: (this: StreamClient, activities: ActivityToDelete[]) => Promise<APIResponse>; // eslint-disable-line no-use-before-define
211 deleteReactions?: (this: StreamClient, ids: string[]) => Promise<APIResponse>; // eslint-disable-line no-use-before-define
212 exportUserActivitiesAndReactionIDs?: (this: StreamClient, userId: string) => Promise<ExportIDsResponse>; // eslint-disable-line no-use-before-define
213
214 /**
215 * Initialize a client

Callers

nothing calls this directly

Calls 3

sendMethod · 0.95
enrichKwargsMethod · 0.95
testMethod · 0.80

Tested by

no test coverage detected