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

Method setUser

src/client.ts:917–928  ·  view source on GitHub ↗
(data: StreamFeedGenerics['userType'])

Source from the content-addressed store, hash-verified

915 }
916
917 async setUser(data: StreamFeedGenerics['userType']) {
918 if (this.usingApiSecret) {
919 throw new SiteError('This method can only be used client-side using a user token');
920 }
921
922 const body = { ...data };
923 delete body.id;
924
925 const user = await (this.currentUser as StreamUser<StreamFeedGenerics>).getOrCreate(body);
926 this.currentUser = user;
927 return user;
928 }
929
930 og(url: string) {
931 return this.get<OGAPIResponse>({

Callers 2

createUsersMethod · 0.80
test.tsFile · 0.80

Calls 1

getOrCreateMethod · 0.80

Tested by

no test coverage detected