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

Method feed

src/client.ts:507–523  ·  view source on GitHub ↗

* Returns a feed object for the given feed id and token * @link https://getstream.io/activity-feeds/docs/node/adding_activities/?language=js * @method feed * @memberof StreamClient.prototype * @param {string} feedSlug - The feed slug * @param {string} [userId] - The user identifier

(
    feedSlug: string,
    userId?: string | StreamUser<StreamFeedGenerics>,
    token?: string,
  )

Source from the content-addressed store, hash-verified

505 * @example client.feed('user', '1');
506 */
507 feed(
508 feedSlug: string,
509 userId?: string | StreamUser<StreamFeedGenerics>,
510 token?: string,
511 ): StreamFeed<StreamFeedGenerics> {
512 if (userId instanceof StreamUser) userId = userId.id;
513
514 if (token === undefined) {
515 if (this.usingApiSecret) {
516 token = JWTScopeToken(this.apiSecret as string, '*', '*', { feedId: `${feedSlug}${userId}` });
517 } else {
518 token = this.userToken as string;
519 }
520 }
521
522 return new StreamFeed<StreamFeedGenerics>(this, feedSlug, userId || (this.userId as string), token);
523 }
524
525 /**
526 * Combines the base url with version and the relative url

Callers 15

createFeedWithTokenFunction · 0.80
beforeEachNodeFunction · 0.80
user_flag.jsFile · 0.80
profile.jsFile · 0.80
enrich.jsFile · 0.80
permissions.jsFile · 0.80
to_targets.jsFile · 0.80
activities.jsFile · 0.80
reaction.jsFile · 0.80
follow_list.jsFile · 0.80

Calls 1

JWTScopeTokenFunction · 0.90

Tested by

no test coverage detected