1
0
Fork
You've already forked node-session-client
0
Node implementation of free, cross-platform, onion-routed GetSession.org client. Fork of https://github.com/hesiod-project/node-session-client
  • JavaScript 100%
Find a file
2026年02月15日 12:06:30 +00:00
.github Create FUNDING.yml 2022年08月13日 23:22:45 -07:00
docs update docs 2023年01月21日 00:39:29 +00:00
external Drop browser support in mnemonic.js 2026年01月08日 13:51:05 +00:00
lib Allow external message send error handling 2026年02月15日 12:06:30 +00:00
.eslintignore ignore docs dir 2020年09月06日 16:40:54 -07:00
.eslintrc.js space always after async, allow no space after brace 2020年09月06日 16:41:27 -07:00
.gitignore Add seed and lastHash to .gitignore 2020年09月07日 20:46:34 +03:00
LICENSE Create LICENSE 2022年07月14日 23:01:28 -07:00
LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX.png try adding qrcode 2020年09月06日 17:27:53 -07:00
package-lock.json npm audit fix 2023年09月01日 21:33:51 -07:00
package.json add sumo 2022年11月20日 06:56:44 +00:00
README.md Include CLI git clone instructions 2023年07月04日 11:33:24 -07:00
sample.js improve error handling 2023年02月24日 23:38:09 +00:00
session-client.js Allow external message send error handling 2026年02月15日 12:06:30 +00:00

node-session-client

Implementation of Session protocol in node

Supports

  • Session protocol support (Direct messaging)
  • Recovery Phrase (13 words)
  • Support for communicating with the Loki 10.x network
  • File server v2
  • Avatars
  • Attachments
  • Open groups v3
    • receiving blinded public/open messages
    • sending blinded public/open messages
    • delete blinded public/open messages
    • receiving blinded DMs (inbox)
    • display names

Working on:

  • LNS
  • bugs / error codes
  • closed group support
  • relying on less 3rd party NPMs (for security reasons)
  • pure web version

installing nodejs

CentOS NodeJS installation:

curl -sL https://rpm.nodesource.com/setup_18.x | sudo bash -

Ubuntu/Debian NodeJS installation:

curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -

then

sudo apt-get install -y nodejs

clone repo

You can clone the repo many ways. I will include how to do this from the command line:

This makes a local copy of the repo via https

git clone https://github.com/hesiod-project/node-session-client

Be sure to be inside of the project repo for the next steps

cd node-session-client

install dependencies

from inside the project root directory

npm i

Example Usage

  1. set up library instance, be sure to adjust path in require if not in the project root.
const SessionClient = require('./session-client.js')
// You'll want an instance per SessionID you want to receive messages for
const client = new SessionClient()
  1. Set up identity and send a message

To generate a new identity and save it to disk as seed.txt. please change YOUR_SESSON_ID_GOES_HERE to your Session ID

const fs = require('fs')
client.loadIdentity({
 seed: fs.existsSync('seed.txt') && fs.readFileSync('seed.txt').toString(),
 displayName: 'Sample Session Client',
}).then(async () => {
 // output recovery phrase if making an identity
 console.log(client.identityOutput)
 
 const SessionID = "YOUR_SESSON_ID_GOES_HERE"
 client.send(SessionID, 'Hello').then(() => {
 console.debug('Sent "Hello" to', SessionID)
 })
})

Detailed Example

Example

Documentation

Auto-generated Detailed Documentation

Support our work

Development depends on your support LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX

QR Code: oxen://LT2mP2DrmGD82gFnH16ty8ZtP6f33czpA6XgQdnuTVeT5bNGyy3vnaUezzKq1rEYyq3cvb2GBZ5LjCC6uqDyKnbvFki9aAX