Skip to content

Commit

Permalink
update readme with nodejs steps (#357)
Browse files Browse the repository at this point in the history
* update readme with nodejs steps

* close tick

* improve
  • Loading branch information
ryanio authored Feb 21, 2024
1 parent 19afa0e commit 069adf4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Documentation: https://docs.opensea.io/reference/stream-api-overview

# Installation

We recommend switching to Node.js version 16 to make sure common crypto dependencies work. Our minimum supported version is 16.11.0.
Please use Node.js version 16 or greater to make sure common crypto dependencies work.

- Install this package with `npm install @opensea/stream-js`
- **NodeJS only:** Install the WebSocket library with `npm install ws`
- Install the required dev-dependency to use the Phoenix client for web socket connections `npm install --save-dev @types/phoenix`
- Install this package: `npm install @opensea/stream-js`
- Install types for phoenix: `npm install --save-dev @types/phoenix`
- **NodeJS only:** Install required libraries: `npm install ws node-localstorage`

# Getting Started

Expand All @@ -51,16 +51,18 @@ const client = new OpenSeaStreamClient({
});
```

### Node.JS
### Node.js

```typescript
import { OpenSeaStreamClient } from '@opensea/stream-js';
import { WebSocket } from 'ws';
import { LocalStorage } from 'node-localstorage';

const client = new OpenSeaStreamClient({
token: 'YOUR_OPENSEA_API_KEY',
connectOptions: {
transport: WebSocket
transport: WebSocket,
sessionStorage: LocalStorage
}
});
```
Expand Down

0 comments on commit 069adf4

Please sign in to comment.