Activities
An activity is a verb + object (plus optional target, foreign_id, time, and a
custom payload) posted to a feed. On write, it fans out along every follow edge
pointing at that feed (spec §1) — that’s how a post on user:diego ends up in
timeline:maya if maya follows diego. Deletes are soft: the activity row is marked
deleted, not removed, while its fan-out copies are hard-deleted so the read path never
has to filter deleted_at (spec design).
Add an activity
Section titled “Add an activity”const activity = await client.feed('user', 'maya').addActivity({ verb: 'workout', object: 'workout:1234', foreign_id: 'maya-w0', // optional — stable id makes retries idempotent time: new Date().toISOString(), // optional — defaults server-side custom: { sport: 'run', durationMin: 45 },})import { useFeedActions } from '@dropin/react'
function Composer() { const { addActivity } = useFeedActions<{ sport: string; durationMin: number }>('user', 'maya') return ( <button onClick={() => addActivity({ verb: 'workout', object: 'workout:1234', custom: { sport: 'run', durationMin: 45 } })}> Post </button> )}A feed already loaded with useFeed/useTimeline/useUserFeed also returns its own
addActivity, which prepends the new activity into that hook’s activities list
immediately — reach for that one when you’re posting into a feed you’re also rendering.
const activity = await server.feed('user', 'maya').addActivity({ verb: 'workout', object: 'workout:1234', foreign_id: 'maya-w0', custom: { sport: 'run', durationMin: 45 },})The server SDK’s addActivity takes a plain Record<string, unknown> rather than the
client’s typed shape — it’s meant for backend seeding/import, not for building a typed
UI payload.
Delete an activity
Section titled “Delete an activity”// Hits DELETE /v1/activities/:id. The gateway enforces authority = origin_feed —// deleting an activity you don't own returns FORBIDDEN.await client.feed('user', 'maya').removeActivity(activity.id)const { deleteActivity } = useFeedActions('user', 'maya')await deleteActivity(activity.id)DropInServer has no delete/remove-activity method — deleting is only exposed through
the client SDK’s removeActivity, scoped to the feed that owns the activity.