Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

getstream

Package Overview
Dependencies
Maintainers
1
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getstream

The official low-level GetStream.io client for Node.js and the browser.

  • 0.1.30
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
decreased by-10.91%
Maintainers
1
Weekly downloads
 
Created
Source

stream-js

Build Status Coverage Status Dependencies up to date

Sauce Test Status

stream-node is a Node/Javascript client for Stream.

var stream = require('getstream');
// Instantiate a new client (server side)
client = stream.connect('YOUR_API_KEY', 'API_KEY_SECRET');
// Instantiate a new client (client side)
client = stream.connect('YOUR_API_KEY');
// Find your API keys here https://getstream.io/dashboard/

// Instantiate a feed object server side
user1 = client.feed('user:1');
// Instantiate a feed object client side
user1 = client.feed('user:1', 'FEED_SECRET');

// Get activities from 5 to 10 (slow pagination)
user1.get({limit:5, offset:5}, callback);
// (Recommended & faster) Filter on an id less than 112334
user1.get({limit:5, id_lt:112334}, callback);

// Create a new activity
activity = {'actor': 1, 'verb': 'tweet', 'object': 1};
user1.addActivity(activity, callback);

// Remove an activity by its id
user1.removeActivity('12345678910');

// Follow another feed
user1.follow('flat:42');

// Stop following another feed
user1.unfollow('flat:42');

// all methods support callback as the last argument
user1.follow('flat:42', callback);
// with this signature
function(error, response, body) {
}

Faye

Stream uses Faye for realtime notifications. Below is quick quide to subcribing to feed changes

var stream = require('getstream');
// NOTE: the site id is needed for subscribing
client = stream.connect('YOUR_API_KEY', 'API_KEY_SECRET', 'SITE_ID');
user1 = client.feed('user:1');
user1.subscribe(function callback() {
});
// now whenever something changes to the feed user 1
// the callback will be called

Docs are available on GetStream.io.

Installation

Install from NPM

npm install getstream

Install using bower

bower install getstream

Contributing

First, make sure you can run the test suite. Tests are run via Mocha

mocha test/integration/index.js
# browser version
test/browser/test.html
# coverage
mocha test/integration/cov.js -R html-cov > cov.html

To release a new version

# package.json is leading and overwrites bower.json version
gulp bump
# builds the browserify, tags and submits to npm
gulp publish

FAQs

Package last updated on 27 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc