Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@signalk/client
Advanced tools
A Javascript SDK for Signal K clients. Provides various abstract interfaces for discovering (via optional mDNS) the Signal K server and communication via WebSocket & REST. Aims to implement all major APIs in the most recent Signal K version(s)
A Javascript SDK for Signal K clients. Provides various abstract interfaces for discovering (via optional mDNS) the Signal K server and communication via WebSocket & REST. Aims to implement all major APIs in the most recent Signal K version(s).
This is not yet published on Github. If you'd like to use an early version, use the following command to install the SDK in your project:
[sudo] npm install --save @signalk/client
import Client, { Discovery } from '@signalk/signalk-js-sdk'
import mdns from 'mdns'
let client = null
// Instantiate client
client = new Client({
hostname: 'demo.signalk.org',
port: 80,
useTLS: true,
reconnect: true,
autoConnect: false
})
// Instantiate client with authentication
client = new Client({
hostname: 'hq.decipher.digital',
port: 3000,
useTLS: true,
useAuthentication: true,
reconnect: true,
autoConnect: false,
username: 'sdk@decipher.industries',
password: 'signalk'
})
// Discover client using mDNS
// Params: mdns lib, search time
const discovery = new Discovery(mdns, 60000)
// Timeout fires when search time is up and no servers were found
discovery.on('timeout', () => console.log('No SK servers found'))
// Found fires when a SK server was found
discovery.on('found', server => {
if (server.isMain() && server.isMaster()) {
client = server.createClient({
useTLS: false,
useAuthentication: true,
reconnect: true,
autoConnect: true,
username: 'sdk@decipher.industries',
password: 'signalk'
})
}
})
// Subscribe to specific paths over WS
const subscription = {
context: 'vessels.self',
subscribe: [{ path: 'navigation.position' }]
}
client
.connect()
.then(() => client.subscribe(subscription))
.catch(err => done(err))
client.on('delta', delta => {
// do something with incoming delta message from subscription
})
// Subscribe to all paths over WS
client
.connect()
.then(() => client.subscribe())
.catch(err => done(err))
client.on('delta', delta => {
// do something with incoming delta message from subscription
})
// Unsubscribe
client.unsubscribe()
// REST API usage
// 1. Fetch an entire group
client
.API() // create REST API client
.then(api => api.navigation())
.then(navigationGroupResult => {
// Do something with navigation group data
})
// 2. Fetch a specific path
client
.API() // create REST API client
.then(api => api.get('/vessels/self/navigation/position')) // Path can be specified using dotnotation and slashes
.then(positionResult => {
// Do something with position data
})
// 3. Fetch meta for a specific path
client
.API() // create REST API client
.then(api => api.getMeta('vessels.self.navigation.position'))
.then(positionMetaResult => {
// Do something with position meta data
})
// 4. Fetch the entire tree for the local vessel
client
.API() // create REST API client
.then(api => api.self())
.then(selfResult => {
// Do something with boat data
})
// ... check out the tests for more REST API examples
Angular: Signal K client for the Angular framework signalk-client-angular
signalk-schema
, auto-generated tests for each path so client can be used to test-drive serversWebWorker
for each Connection
, offloading server comms to a different threadPUT requests via REST
have been implemented, but don't have a valid test yet. Need to figure out how to test thisJWT
if no token.type
is returned by a SK server. IMHO that default should be Bearer
. See issue https://github.com/SignalK/signalk-server-node/issues/715 & PR https://github.com/SignalK/specification/pull/535FAQs
A Javascript SDK for Signal K clients. Provides various abstract interfaces for discovering (via optional mDNS) the Signal K server and communication via WebSocket & REST. Aims to implement all major APIs in the most recent Signal K version(s)
The npm package @signalk/client receives a total of 183 weekly downloads. As such, @signalk/client popularity was classified as not popular.
We found that @signalk/client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.