@@ -22,12 +22,70 @@ Working on:
2222- relying on less 3rd party NPMs (for security reasons)
2323- pure web version
2424
25- [ Documentation] ( https://hesiod-project.github.io/node-session-client/ )
25+ ## installing nodejs
26+
27+ ### CentOS NodeJS installation:
28+
29+ ` curl -sL https://rpm.nodesource.com/setup_18.x | sudo bash - `
30+
31+ ### Ubuntu/Debian NodeJS installation:
32+
33+ ` curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - `
34+
35+ then
36+
37+ ` sudo apt-get install -y nodejs `
38+
39+ ## install dependencies
40+
41+ from inside the project root directory
42+
43+ ` npm i `
44+
45+ ## Example Usage
46+
47+ 1 . set up library instance, be sure to adjust path in require if not in the project root.
48+
49+ ``` js
50+ const SessionClient = require (' ./session-client.js' )
51+
52+ // You'll want an instance per SessionID you want to receive messages for
53+ const client = new SessionClient ()
54+ ```
55+
56+ 2 . Set up identity and send a message
57+
58+ To generate a new identity and save it to disk as ` seed.txt ` . please change ` YOUR_SESSON_ID_GOES_HERE ` to your Session ID
59+
60+ ``` js
61+ const fs = require (' fs' )
62+ client .loadIdentity ({
63+ seed: fs .existsSync (' seed.txt' ) && fs .readFileSync (' seed.txt' ).toString (),
64+ displayName: ' Sample Session Client' ,
65+ }).then (async () => {
66+ // output recovery phrase if making an identity
67+ console .log (client .identityOutput )
68+
69+ const SessionID = " YOUR_SESSON_ID_GOES_HERE"
70+ client .send (SessionID, ' Hello' ).then (() => {
71+ console .debug (' Sent "Hello" to' , SessionID)
72+ })
73+ })
74+ ```
75+
76+ ## Detailed Example
2677
2778[ Example] ( sample.js )
2879
80+ ## Documentation
81+
82+ [ Auto-generated Detailed Documentation] ( https://hesiod-project.github.io/node-session-client/ )
83+
84+
85+ # Support our work
86+
2987Development depends on your support
3088LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX
3189
3290QR Code:
33- ![ LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX] ( LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX.png )
91+ ![ oxen:// LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX] ( LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX.png )
0 commit comments