DropInClient
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DropInClient(opts): DropInClient;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
DropInClientOptions |
Returns
Section titled “Returns”DropInClient
Properties
Section titled “Properties”notifications
Section titled “notifications”readonly notifications: object;get: (q, opts) => Promise<NotificationPage>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<NotificationPage>
head: (opts) => Promise<{ changed: number | null; latest: string | null;}>;Cheap change signal for the caller’s notifications. See feed().head().
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<{
changed: number | null;
latest: string | null;
}>
markRead
Section titled “markRead”markRead: (ids?, opts) => Promise<void>;Mark specific notifications read, or all when no ids are given (an empty array = all).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ids? |
string[] |
opts? |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
markSeen
Section titled “markSeen”markSeen: (ids?, opts) => Promise<void>;Mark specific notifications seen, or all when no ids are given (an empty array = all).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ids? |
string[] |
opts? |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
objects
Section titled “objects”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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
type |
string |
id |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<DropInObject<TCustom>>
getMany
Section titled “getMany”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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
refs |
string[] |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<Record<string, DropInObject<TCustom>>>
reactions
Section titled “reactions”readonly reactions: object;add: (kind, activityId, custom, opts) => Promise<Reaction>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
kind |
string |
activityId |
string |
custom |
Record<string, unknown> |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<Reaction>
delete
Section titled “delete”delete: (reactionId, opts) => Promise<void>;GetStream parity: delete a reaction by its id (from add()/list()).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
reactionId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
list: (activityId, q, opts) => Promise<Page<Reaction>>;A page of reactions on an activity, newest first. Optional kind filters server-side.
Parameters
Section titled “Parameters”| 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 |
Returns
Section titled “Returns”unreact
Section titled “unreact”unreact: (activityId, kind, opts) => Promise<void>;Remove the caller’s own reaction of a kind from an activity (no id needed).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activityId |
string |
kind |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
readonly users: object;me: (opts) => Promise<{ custom: Record<string, unknown>; id: string;}>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<{
custom: Record<string, unknown>;
id: string;
}>
Methods
Section titled “Methods”feed()
Section titled “feed()”feed(group, id): object;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
group |
string |
id |
string |
Returns
Section titled “Returns”addActivity
Section titled “addActivity”addActivity: <TCustom>(a, opts) => Promise<Activity<TCustom>>;Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| 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 |
- |
Returns
Section titled “Returns”Promise<Activity<TCustom>>
follow
Section titled “follow”follow: (tGroup, tId, opts) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tGroup |
string |
tId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
followers
Section titled “followers”followers: (q, opts) => Promise<Page<Follow>>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”following
Section titled “following”following: (q, opts) => Promise<Page<Follow>>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”followStats
Section titled “followStats”followStats: (opts) => Promise<FollowStats>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<FollowStats>
get: <TCustom>(q, opts) => Promise<FeedPage<TCustom>>;Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”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 changeslatestcannot 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;nullmeans 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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<{
changed: number | null;
latest: string | null;
}>
removeActivity
Section titled “removeActivity”removeActivity: (activityId, opts) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activityId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
suggestions
Section titled “suggestions”suggestions: (q, opts) => Promise<{ results: Suggestion[];}>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ limit?: number; } |
q.limit? |
number |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<{
results: Suggestion[];
}>
unfollow
Section titled “unfollow”unfollow: (tGroup, tId, opts) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tGroup |
string |
tId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
updateActivity
Section titled “updateActivity”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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activityId |
string |
body |
PatchBody |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<Activity<TCustom>>
timeline()
Section titled “timeline()”timeline(id): object;Sugar for feed('timeline', id) — the feed that aggregates who you follow.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”addActivity
Section titled “addActivity”addActivity: <TCustom>(a, opts) => Promise<Activity<TCustom>>;Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| 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 |
- |
Returns
Section titled “Returns”Promise<Activity<TCustom>>
follow
Section titled “follow”follow: (tGroup, tId, opts) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tGroup |
string |
tId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
followers
Section titled “followers”followers: (q, opts) => Promise<Page<Follow>>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”following
Section titled “following”following: (q, opts) => Promise<Page<Follow>>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”followStats
Section titled “followStats”followStats: (opts) => Promise<FollowStats>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<FollowStats>
get: <TCustom>(q, opts) => Promise<FeedPage<TCustom>>;Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”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 changeslatestcannot 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;nullmeans 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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<{
changed: number | null;
latest: string | null;
}>
removeActivity
Section titled “removeActivity”removeActivity: (activityId, opts) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activityId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
suggestions
Section titled “suggestions”suggestions: (q, opts) => Promise<{ results: Suggestion[];}>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ limit?: number; } |
q.limit? |
number |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<{
results: Suggestion[];
}>
unfollow
Section titled “unfollow”unfollow: (tGroup, tId, opts) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tGroup |
string |
tId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
updateActivity
Section titled “updateActivity”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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activityId |
string |
body |
PatchBody |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<Activity<TCustom>>
userFeed()
Section titled “userFeed()”userFeed(id): object;Sugar for feed('user', id) — a single user’s own activity feed.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”addActivity
Section titled “addActivity”addActivity: <TCustom>(a, opts) => Promise<Activity<TCustom>>;Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| 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 |
- |
Returns
Section titled “Returns”Promise<Activity<TCustom>>
follow
Section titled “follow”follow: (tGroup, tId, opts) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tGroup |
string |
tId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
followers
Section titled “followers”followers: (q, opts) => Promise<Page<Follow>>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”following
Section titled “following”following: (q, opts) => Promise<Page<Follow>>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”followStats
Section titled “followStats”followStats: (opts) => Promise<FollowStats>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<FollowStats>
get: <TCustom>(q, opts) => Promise<FeedPage<TCustom>>;Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ cursor?: string; limit?: number; next?: string; } |
q.cursor? |
string |
q.limit? |
number |
q.next? |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”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 changeslatestcannot 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;nullmeans 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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<{
changed: number | null;
latest: string | null;
}>
removeActivity
Section titled “removeActivity”removeActivity: (activityId, opts) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activityId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
suggestions
Section titled “suggestions”suggestions: (q, opts) => Promise<{ results: Suggestion[];}>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
q |
{ limit?: number; } |
q.limit? |
number |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<{
results: Suggestion[];
}>
unfollow
Section titled “unfollow”unfollow: (tGroup, tId, opts) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tGroup |
string |
tId |
string |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<void>
updateActivity
Section titled “updateActivity”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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activityId |
string |
body |
PatchBody |
opts |
RequestOptions |
Returns
Section titled “Returns”Promise<Activity<TCustom>>