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 Dec 21, 2021. It is now read-only.
The id parameter of client.createStream can be a path (or full stream id, as previously). It will be prefixed with a lowercased Ethereum address derived from user's private key.
E.g.
client.createStream({
id: '/foo/bar'
})
// -> creates 0xabcdeabcde123456789012345678901234567890/foo/bar
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,8 +94,8 @@ See "Subscription options" for resend options
94
94
### Programmatically creating a stream
95
95
96
96
```js
97
-
conststream=awaitclient.getOrCreateStream({
98
-
name:'My awesome stream created via the API',
97
+
conststream=awaitclient.createStream({
98
+
id:'/foo/bar', // or 0x1234567890123456789012345678901234567890/foo/bar or mydomain.eth/foo/bar
99
99
})
100
100
console.log(`Stream ${stream.id} has been created!`)
101
101
@@ -328,7 +328,7 @@ All the below functions return a Promise which gets resolved with the result.
328
328
| getStream(streamId) | Fetches a stream object from the API. |
329
329
| listStreams(query) | Fetches an array of stream objects from the API. For the query params, consult the [API docs](https://api-explorer.streamr.com). |
330
330
| getStreamByName(name) | Fetches a stream which exactly matches the given name. |
331
-
| createStream(\[properties]) | Creates a stream with the given properties. For more information on the stream properties, consult the [API docs](https://api-explorer.streamr.com). |
331
+
| createStream(\[properties]) | Creates a stream with the given properties. For more information on the stream properties, consult the [API docs](https://api-explorer.streamr.com). If you specify `id`, it can be a full streamId or a path (e.g. `/foo/bar` will create a stream with id `<your-etherereum-address>/foo/bar` if you have authenticated with a private key)|
332
332
| getOrCreateStream(properties) | Gets a stream with the id or name given in `properties`, or creates it if one is not found. |
333
333
| publish(streamId, message, timestamp, partitionKey) | Publishes a new message to the given stream. |
0 commit comments