You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 15, 2023. It is now read-only.
This package helps you create activity streams & newsfeeds with NodeJS and [GetStream.io](https://getstream.io).
6
+
[stream-node-orm](https://github.com/GetStream/stream-node-orm) is a Node.js (Sails, Waterline) client for [Stream](https://getstream.io/).
7
7
8
-
###Build activity streams & news feeds
8
+
You can sign up for a Stream account at https://getstream.io/get_started.
9
+
10
+
Note there is also a lower level [Node.js - Stream integration](https://github.com/getstream/stream-js) library which is suitable for all JavaScript applications.
11
+
12
+
### Build activity streams & news feeds
9
13
10
14
<palign="center">
11
15
<imgsrc="https://dvqg2dogggmn6.cloudfront.net/images/mood-home.png"alt="Examples of what you can build"title="What you can build"/>
@@ -40,7 +44,7 @@ Install getstream_node package with npm:
40
44
41
45
#### Step 2 - Config file
42
46
43
-
Copy `getstream.js` config file from `node_modules/getstream-node` into the root directory of your application
47
+
Copy `getstream.js` config file from `node_modules/getstream-node` into the root directory of your application
44
48
Make sure you require the getstream-node early on in your application (eg. in app.js)
45
49
46
50
#### Step 3 - Get your API key
@@ -50,7 +54,7 @@ Login with Github on [getstream.io](https://getstream.io/) and edit the configur
50
54
51
55
###Model integration
52
56
53
-
Stream Nodejs can automatically publish new activities to your feeds. To do that you only need to register the models you want to publish with this library.
57
+
Stream Node.js can automatically publish new activities to your feeds. To do that you only need to register the models you want to publish with this library.
54
58
55
59
```js
56
60
var stream =require('getstream-node');
@@ -73,8 +77,8 @@ Every time a Tweet is created it will be added to the user's feed. Users which f
73
77
Models are stored in feeds as activities. An activity is composed of at least the following fields: **actor**, **verb**, **object**, **time**. You can also add more custom data if needed.
74
78
The Activity mixin will try to set things up automatically:
75
79
76
-
**object** is a reference to the model instance
77
-
**actor** is a reference to the user attribute of the instance
80
+
**object** is a reference to the model instance
81
+
**actor** is a reference to the user attribute of the instance
78
82
**verb** is a string representation of the class name
79
83
80
84
By default the actor field will look for an attribute called user or actor and a field called created_at to track creation time.
When needed you can also use the [low level JavaScript API](https://github.com/getstream/stream-js) directly. Documentation is available at the [Stream website](https://getstream.io/docs/?language=js).
238
240
239
241
```js
240
242
var streamNode =require('getstream-node');
241
243
var client =streamNode.FeedManager.client
242
244
// client.addActivity, client.removeActivity etc are all available
243
245
```
244
246
245
-
The full documentation for the low level API is available in the [getstream.io documentation](https://getstream.io/docs/).
246
-
247
247
### Enrichment
248
248
249
249
You can use the enrichment capabilities of this library directly.
By default the enrichment system assumes that you're referencing items by their id. Sometimes you'll want to customize this behaviour. You might for instance use a username instead of an id. Alternatively you might mant to use a caching layer instead of the ORM for loading the data. The example below shows how to customize the lookup for all User entries.
267
+
By default the enrichment system assumes that you're referencing items by their id. Sometimes you'll want to customize this behaviour. You might for instance use a username instead of an id. Alternatively you might mant to use a caching layer instead of the ORM for loading the data. The example below shows how to customize the lookup for all User entries.
0 commit comments