Skip to content

DropInClient

new DropInClient(opts): DropInClient;
Parameter Type
opts DropInClientOptions

DropInClient

readonly notifications: object;
get: (q, opts) => Promise<NotificationPage>;
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<NotificationPage>

head: (opts) => Promise<{
changed: number | null;
latest: string | null;
}>;

Cheap change signal for the caller’s notifications. See feed().head().

Parameter Type
opts RequestOptions

Promise<{ changed: number | null; latest: string | null; }>

markRead: (ids?, opts) => Promise<void>;

Mark specific notifications read, or all when no ids are given (an empty array = all).

Parameter Type
ids? string[]
opts? RequestOptions

Promise<void>

markSeen: (ids?, opts) => Promise<void>;

Mark specific notifications seen, or all when no ids are given (an empty array = all).

Parameter Type
ids? string[]
opts? RequestOptions

Promise<void>


readonly objects: object;

Objects are server-write-only — this client can read them, never write them.

get: <TCustom>(type, id, opts) => Promise<DropInObject<TCustom>>;
Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type
type string
id string
opts RequestOptions

Promise<DropInObject<TCustom>>

getMany: <TCustom>(refs, opts) => Promise<Record<string, DropInObject<TCustom>>>;

Re-read up to 100 objects in ONE request, keyed by type:id. This is how a rendered page revalidates its objects sidecar: get() per card is N requests for N cards, and objects are the mutable half of a feed, so that sweep repeats.

Refs with no stored object are absent from the map — the same contract as the feed-read sidecar, so a deleted object never fails the sweep. Compare each returned updated_at against what you hold and re-render only what moved.

An empty list costs zero requests rather than a 400: a page that renders no refs is a normal state, not a caller error.

Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type
refs string[]
opts RequestOptions

Promise<Record<string, DropInObject<TCustom>>>


readonly reactions: object;
add: (kind, activityId, custom, opts) => Promise<Reaction>;
Parameter Type
kind string
activityId string
custom Record<string, unknown>
opts RequestOptions

Promise<Reaction>

delete: (reactionId, opts) => Promise<void>;

GetStream parity: delete a reaction by its id (from add()/list()).

Parameter Type
reactionId string
opts RequestOptions

Promise<void>

list: (activityId, q, opts) => Promise<Page<Reaction>>;

A page of reactions on an activity, newest first. Optional kind filters server-side.

Parameter Type
activityId string
q { cursor?: string; kind?: string; limit?: number; next?: string; }
q.cursor? string
q.kind? string
q.limit? number
q.next? string
opts RequestOptions

Promise<Page<Reaction>>

unreact: (activityId, kind, opts) => Promise<void>;

Remove the caller’s own reaction of a kind from an activity (no id needed).

Parameter Type
activityId string
kind string
opts RequestOptions

Promise<void>


readonly users: object;
me: (opts) => Promise<{
custom: Record<string, unknown>;
id: string;
}>;
Parameter Type
opts RequestOptions

Promise<{ custom: Record<string, unknown>; id: string; }>

feed(group, id): object;
Parameter Type
group string
id string
addActivity: <TCustom>(a, opts) => Promise<Activity<TCustom>>;
Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type Description
a { custom?: TCustom; foreign_id?: string | null; object: string; refs?: string[]; target?: string | null; time?: string; verb: string; } -
a.custom? TCustom -
a.foreign_id? string | null -
a.object string -
a.refs? string[] Objects this activity points at, as type:id. Max 4. Resolved into the feed read’s objects sidecar.
a.target? string | null -
a.time? string -
a.verb string -
opts RequestOptions -

Promise<Activity<TCustom>>

follow: (tGroup, tId, opts) => Promise<void>;
Parameter Type
tGroup string
tId string
opts RequestOptions

Promise<void>

followers: (q, opts) => Promise<Page<Follow>>;
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<Page<Follow>>

following: (q, opts) => Promise<Page<Follow>>;
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<Page<Follow>>

followStats: (opts) => Promise<FollowStats>;
Parameter Type
opts RequestOptions

Promise<FollowStats>

get: <TCustom>(q, opts) => Promise<FeedPage<TCustom>>;
Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<FeedPage<TCustom>>

head: (opts) => Promise<{
changed: number | null;
latest: string | null;
}>;

Cheap change signal, Redis-only server-side. Two independent fields:

  • latest — opaque token for NEW activities. Compare with the last value you acted on; null means nothing new.
  • changed — tenant mutation counter, covering the changes latest cannot report: an activity edited, a reaction moved, an object written. Unchanged since your last revalidation means you can skip re-reading the page and its objects entirely. 0 means nothing has ever been mutated here; null means unknown (a corrupted counter) — revalidate rather than assume.

It is tenant-wide, so another feed’s write can make yours revalidate once. That is the price of a signal an object write can actually reach: an object does not know which feeds reference it.

Parameter Type
opts RequestOptions

Promise<{ changed: number | null; latest: string | null; }>

removeActivity: (activityId, opts) => Promise<void>;
Parameter Type
activityId string
opts RequestOptions

Promise<void>

suggestions: (q, opts) => Promise<{
results: Suggestion[];
}>;
Parameter Type
q { limit?: number; }
q.limit? number
opts RequestOptions

Promise<{ results: Suggestion[]; }>

unfollow: (tGroup, tId, opts) => Promise<void>;
Parameter Type
tGroup string
tId string
opts RequestOptions

Promise<void>

updateActivity: <TCustom>(activityId, body, opts) => Promise<Activity<TCustom>>;

Patch an activity’s custom and/or refs. Permitted on your own activities only. body.refs, when present, replaces the refs array wholesale ([] clears it) — the backfill path for attaching objects to an activity posted before they existed, without the delete-and-repost that would otherwise burn its foreign_id and re-fan-out to every follower.

Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type
activityId string
body PatchBody
opts RequestOptions

Promise<Activity<TCustom>>


timeline(id): object;

Sugar for feed('timeline', id) — the feed that aggregates who you follow.

Parameter Type
id string
addActivity: <TCustom>(a, opts) => Promise<Activity<TCustom>>;
Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type Description
a { custom?: TCustom; foreign_id?: string | null; object: string; refs?: string[]; target?: string | null; time?: string; verb: string; } -
a.custom? TCustom -
a.foreign_id? string | null -
a.object string -
a.refs? string[] Objects this activity points at, as type:id. Max 4. Resolved into the feed read’s objects sidecar.
a.target? string | null -
a.time? string -
a.verb string -
opts RequestOptions -

Promise<Activity<TCustom>>

follow: (tGroup, tId, opts) => Promise<void>;
Parameter Type
tGroup string
tId string
opts RequestOptions

Promise<void>

followers: (q, opts) => Promise<Page<Follow>>;
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<Page<Follow>>

following: (q, opts) => Promise<Page<Follow>>;
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<Page<Follow>>

followStats: (opts) => Promise<FollowStats>;
Parameter Type
opts RequestOptions

Promise<FollowStats>

get: <TCustom>(q, opts) => Promise<FeedPage<TCustom>>;
Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<FeedPage<TCustom>>

head: (opts) => Promise<{
changed: number | null;
latest: string | null;
}>;

Cheap change signal, Redis-only server-side. Two independent fields:

  • latest — opaque token for NEW activities. Compare with the last value you acted on; null means nothing new.
  • changed — tenant mutation counter, covering the changes latest cannot report: an activity edited, a reaction moved, an object written. Unchanged since your last revalidation means you can skip re-reading the page and its objects entirely. 0 means nothing has ever been mutated here; null means unknown (a corrupted counter) — revalidate rather than assume.

It is tenant-wide, so another feed’s write can make yours revalidate once. That is the price of a signal an object write can actually reach: an object does not know which feeds reference it.

Parameter Type
opts RequestOptions

Promise<{ changed: number | null; latest: string | null; }>

removeActivity: (activityId, opts) => Promise<void>;
Parameter Type
activityId string
opts RequestOptions

Promise<void>

suggestions: (q, opts) => Promise<{
results: Suggestion[];
}>;
Parameter Type
q { limit?: number; }
q.limit? number
opts RequestOptions

Promise<{ results: Suggestion[]; }>

unfollow: (tGroup, tId, opts) => Promise<void>;
Parameter Type
tGroup string
tId string
opts RequestOptions

Promise<void>

updateActivity: <TCustom>(activityId, body, opts) => Promise<Activity<TCustom>>;

Patch an activity’s custom and/or refs. Permitted on your own activities only. body.refs, when present, replaces the refs array wholesale ([] clears it) — the backfill path for attaching objects to an activity posted before they existed, without the delete-and-repost that would otherwise burn its foreign_id and re-fan-out to every follower.

Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type
activityId string
body PatchBody
opts RequestOptions

Promise<Activity<TCustom>>


userFeed(id): object;

Sugar for feed('user', id) — a single user’s own activity feed.

Parameter Type
id string
addActivity: <TCustom>(a, opts) => Promise<Activity<TCustom>>;
Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type Description
a { custom?: TCustom; foreign_id?: string | null; object: string; refs?: string[]; target?: string | null; time?: string; verb: string; } -
a.custom? TCustom -
a.foreign_id? string | null -
a.object string -
a.refs? string[] Objects this activity points at, as type:id. Max 4. Resolved into the feed read’s objects sidecar.
a.target? string | null -
a.time? string -
a.verb string -
opts RequestOptions -

Promise<Activity<TCustom>>

follow: (tGroup, tId, opts) => Promise<void>;
Parameter Type
tGroup string
tId string
opts RequestOptions

Promise<void>

followers: (q, opts) => Promise<Page<Follow>>;
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<Page<Follow>>

following: (q, opts) => Promise<Page<Follow>>;
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<Page<Follow>>

followStats: (opts) => Promise<FollowStats>;
Parameter Type
opts RequestOptions

Promise<FollowStats>

get: <TCustom>(q, opts) => Promise<FeedPage<TCustom>>;
Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type
q { cursor?: string; limit?: number; next?: string; }
q.cursor? string
q.limit? number
q.next? string
opts RequestOptions

Promise<FeedPage<TCustom>>

head: (opts) => Promise<{
changed: number | null;
latest: string | null;
}>;

Cheap change signal, Redis-only server-side. Two independent fields:

  • latest — opaque token for NEW activities. Compare with the last value you acted on; null means nothing new.
  • changed — tenant mutation counter, covering the changes latest cannot report: an activity edited, a reaction moved, an object written. Unchanged since your last revalidation means you can skip re-reading the page and its objects entirely. 0 means nothing has ever been mutated here; null means unknown (a corrupted counter) — revalidate rather than assume.

It is tenant-wide, so another feed’s write can make yours revalidate once. That is the price of a signal an object write can actually reach: an object does not know which feeds reference it.

Parameter Type
opts RequestOptions

Promise<{ changed: number | null; latest: string | null; }>

removeActivity: (activityId, opts) => Promise<void>;
Parameter Type
activityId string
opts RequestOptions

Promise<void>

suggestions: (q, opts) => Promise<{
results: Suggestion[];
}>;
Parameter Type
q { limit?: number; }
q.limit? number
opts RequestOptions

Promise<{ results: Suggestion[]; }>

unfollow: (tGroup, tId, opts) => Promise<void>;
Parameter Type
tGroup string
tId string
opts RequestOptions

Promise<void>

updateActivity: <TCustom>(activityId, body, opts) => Promise<Activity<TCustom>>;

Patch an activity’s custom and/or refs. Permitted on your own activities only. body.refs, when present, replaces the refs array wholesale ([] clears it) — the backfill path for attaching objects to an activity posted before they existed, without the delete-and-repost that would otherwise burn its foreign_id and re-fan-out to every follower.

Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type
activityId string
body PatchBody
opts RequestOptions

Promise<Activity<TCustom>>