<commit_before># Stream Node

## Getting started

3. Install getstream-node via `npm install stream-node` for your application.
4. Copy `getstream.json` from `node_modules/stream-node` into the root directory of
   your application.
5. Edit `getstream.json` and set your data from your getstream.io account.
6. `require('stream-node');` on your application.

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.<commit_msg>add example code<commit_after># Stream Node

## Getting started

3. Install getstream-node via `npm install stream-node` for your application.
4. Copy `getstream.json` from `node_modules/stream-node` into the root directory of
   your application.
5. Edit `getstream.json` and set your data from your getstream.io account.
6. `require('stream-node');` on your application.

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 backend
----------------


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

```js
connection.model()
```

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

StreamMongoose.activitySchema(tweetSchema);

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

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

tweetSchema.methods.activityActorProp = function() {
  return 'actor';
}
```
{'fraction_non_alphanumeric': 0.1087912087912088, 'fraction_numerical': 0.004395604395604396, 'mean_word_length': 4.340175953079179, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '690881', 'n_tokens_mistral': 526, 'n_tokens_neox': 511, 'n_words': 199}