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.
@neosync/sdk
Advanced tools
This SDK contains the generated types for Neosync API. This SDK is dogfooded by the main Neosync webapp to ensure its durability.
npm install @neosync/sdk
For a prime example of how to us this SDK, view the withNeosyncContext method in the Neosync app's BFF layer.
Based on your usage, you'll have to install a different version of connect
to provide the correct Transport based on your environment.
Install whichever one makes sense for you
npm install @connectrpc/connect-node
npm install @connectrpc/connect-web
Neosync API serves up Connect
, which can listen using Connect, gRPC, or Web protocols.
Each of the libraries above provides all three of those protocols, but it's recommended to use createConnectTransport
for the most efficient setup.
import { getNeosyncClient } from '@neosync/sdk';
import { createConnectTransport } from '@connectrpc/connect-node';
const neosyncClient = getNeosyncClient({
getTransport(interceptors) {
return createConnectTransport({
baseUrl: '<url>',
httpVersion: '2',
interceptors: interceptors,
});
},
});
To authenticate the TS Neosync Client, a function may be provided to the configuration that will be invoked prior to every request. This gives flexability in how the access token may be retrieved and supports either a Neosync API Key or a standard user JWT token.
When the getAccessToken
function is provided, the Neosync Client is configured with an auth interceptor that attaches the Authorization
header to every outgoingn request with the access token returned from the function.
This is why the getTransport
method receives a list of interceptors, and why it's important to hook them up to pass them through to the relevant transport being used.
import { getNeosyncClient } from '@neosync/sdk';
import { createConnectTransport } from '@connectrpc/connect-node';
const neosyncClient = getNeosyncClient({
getAccessToken: () => process.env.NEOSYNC_API_KEY,
getTransport(interceptors) {
return createConnectTransport({
baseUrl: process.env.NEOSYNC_API_URL,
httpVersion: '2',
interceptors: interceptors,
});
},
});
In the Neosync dashboard app, we pull the user access token off of the incoming request (auth is configured using next-auth
.).
This way we can ensure that all requests are using the user's access token and are passed through to Neosync API.
FAQs
Neosync SDK
The npm package @neosync/sdk receives a total of 76 weekly downloads. As such, @neosync/sdk popularity was classified as not popular.
We found that @neosync/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.