Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README for NodeJS instructions #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@ For other usages the bundle is also available at `dist/bundle.js`
Setup the endpoint that you want to fetch data from and the flow control mode:

```javascript
const client = new HyperionStreamClient(ENDPOINT, {async: false});
const client = new HyperionStreamClient(ENDPOINT, HYPERION_CLIENT_OPTIONS);
```
**HYPERION_CLIENT_OPTIONS** can be found in `src/interfaces.ts`

Example:
```javascript
const client = new HyperionStreamClient('https://example.com', {async: false});

// NodeJS
const fetch = require("node-fetch");
const client = new HyperionStreamClient('https://example.com', {async: false, fetch: fetch});
```

`https://example.com` is the host, from where `https://example.com/v2/history/...` is served.
Expand Down