Skip to content

Commit 705e2b3

Browse files
authored
Address #8
1 parent a9d9a4d commit 705e2b3

File tree

1 file changed

+60
-2
lines changed

1 file changed

+60
-2
lines changed

README.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
2987
Development depends on your support
3088
LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX
3189

3290
QR Code:
33-
![LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX](LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX.png)
91+
![oxen://LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX](LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX.png)

0 commit comments

Comments
 (0)