Skip to content

Instantly share code, notes, and snippets.

@nparsons08 nparsons08/instantiate.js Secret
Created Nov 8, 2019

Embed
What would you like to do?
// instantiate a new client
var streamClient = stream.connect(YOUR_API_KEY, YOUR_API_SECRET);
// instantiate a feed using feed class 'user_posts' and the actor user id
var userFeed = streamClient.feed('user_posts', ACTOR_USER_ID);
// build activity object
var activity = {
actor: $actorId,
verb: "add",
object: "upload:$objectId",
foreign_id: "foreign_id:$foreignId",
time: new Date()
}
// add activity to the feed
userFeed.addActivity(activity)
.then(function(response) {
console.log(response);
})
.catch(function(err) {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.