New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

getstream-node

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getstream-node

Build newsfeeds and activity feeds on node.js using getstream.io

  • 0.1.1
  • npm
  • Socket score

Version published
Weekly downloads
37
decreased by-58.89%
Maintainers
1
Weekly downloads
 
Created
Source

Stream Node

Build Status

Install

. Install getstream-node via npm install getstream-node for your application
. Copy getstream.js config file from node_modules/getstream-node into the root directory of your application
. Edit getstream.js and set your API keys (https://getstream.io/dashboard)
. Add require('getstream-node'); early on in your application code

If you wish to keep the configuration for the module separate from your application, the module will look for getstream.json in the directory referenced by the environment variable STREAM_NODE_CONFIG_DIR if it's set.

Mongoose integration

Note: Models created with connect.model are not supported by this integration

connection.model()

Register the models' schemas that you want to store in feeds:

var stream = require('getstream-node');

var tweetSchema = Schema({
  text    : String,
  actor   : { type: Schema.Types.ObjectId, ref: 'User' },
  bg      : String,
  link    : { type: Schema.Types.ObjectId, ref: 'Link' }
});

stream.mongoose.activitySchema(tweetSchema);

Store extra information in feeds:

tweetSchema.methods.activityExtraData = function() {
  return {'bg': this.bg, 'link': this.link};
}

Automatically populate paths:

tweetSchema.statics.pathsToPopulate = function() {
  return ['actor', 'link'];
};

Use custom attribute for the actor field:

tweetSchema.methods.activityActorProp = function() {
  return 'actor';
}

FAQs

Package last updated on 22 Apr 2015

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