File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ This is a best effort delivery messaging system. Messages that are not received
2020We recommend switching to Node.js version 16 to make sure common crypto dependencies work. Our minimum supported version is 16.11.0.
2121
2222- Install this package with ` npm install @opensea/stream-js `
23+ - ** NodeJS only:** Install the WebSocket library with ` npm install ws `
2324- Install the required dev-dependency to use the Phoenix client for web socket connections ` npm install --save-dev @types/phoenix `
2425
2526# Getting Started
@@ -30,6 +31,8 @@ In order to make onboarding easy, we've integrated the OpenSea Stream API with o
3031
3132## Create a client
3233
34+ ### Browser
35+
3336``` javascript
3437import { OpenSeaStreamClient } from ' @opensea/stream-js' ;
3538
@@ -38,6 +41,20 @@ const client = new OpenSeaStreamClient({
3841});
3942```
4043
44+ ### Node.JS
45+
46+ ``` javascript
47+ import { OpenSeaStreamClient } from ' @opensea/stream-js' ;
48+ import { WebSocket } from ' ws' ;
49+
50+ const client = new OpenSeaStreamClient ({
51+ token: ' openseaApiKey'
52+ connectOptions: {
53+ transport: WebSocket
54+ }
55+ });
56+ ```
57+
4158You can also optionally pass in:
4259
4360- a ` network ` if you would like to access testnet networks.
You can’t perform that action at this time.
0 commit comments