newOS for Developers
Back to Search Methods
Activity Stream
Real-time feed of user and network activity
intermediate
GET /user/activityStreamOverview
The activity stream provides a chronological feed of events from users you follow and your own actions. This includes new posts, follows, powerups, and mood updates.
The stream uses reactive signals to push updates in real-time without polling.
API Endpoint
GET
/user/activityStreamQuery Parameters:
since— ISO timestamp to fetch events aftertypes— Filter by event types (optional)limit— Max events to return (default 50)
Usage Example
import { activityStream } from "@newgraph-signals/actions/activityStream";
// Subscribe to activity stream
const stream = activityStream();
// React to new events
effect(() => {
const events = stream.value;
events.forEach(event => {
console.log(`New event: ${event.type}`, event);
});
});
// Filter by event type
const postEvents = activityStream({
types: ["post.created", "post.updated"]
});Event Types
| Type | Description |
|---|---|
| post.created | New post published |
| user.followed | New follower |
| powerup.sent | Powerup/Watts received |
| mood.updated | Mood content changed |
| access.granted | Access given to mood |
Response Schema
{
value: [
{
id: string;
type: string; // Event type
actor: { // Who triggered
id: string;
username: string;
};
target: { // What was affected
id: string;
type: string;
};
created: string; // ISO timestamp
metadata: object; // Event-specific data
}
]
}