From 069adf4349475982795c5bb3acd227f38b0cf799 Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Wed, 21 Feb 2024 11:40:55 -0800 Subject: [PATCH] update readme with nodejs steps (#357) * update readme with nodejs steps * close tick * improve --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index edac426c..67862728 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 } }); ```