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

Method create

src/user.ts:103–118  ·  view source on GitHub ↗

* Create a new user in stream * @link https://getstream.io/activity-feeds/docs/node/users_introduction/?language=js#adding-users * @param {object} data user date stored in stream * @param {boolean} [options.get_or_create] if user already exists return it * @return {Promise }

(data?: StreamFeedGenerics['userType'], options?: { get_or_create?: boolean })

Source from the content-addressed store, hash-verified

101 * @return {Promise<StreamUser>}
102 */
103 async create(data?: StreamFeedGenerics['userType'], options?: { get_or_create?: boolean }) {
104 const response = await this.client.post<UserAPIResponse<StreamFeedGenerics>>({
105 url: 'user/',
106 body: {
107 id: this.id,
108 data: data || this.data || {},
109 },
110 qs: options,
111 token: this.token,
112 });
113
114 this.full = { ...response };
115 delete this.full.duration;
116 this.data = this.full.data;
117 return this;
118 }
119
120 /**
121 * Update the user

Callers 7

getOrCreateMethod · 0.95
kjur.jsFile · 0.80
hFunction · 0.80
jFunction · 0.80
profile.jsFile · 0.80
permissions.jsFile · 0.80
constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected