
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
neon-sdk
Fully-typed, zero-dependency Node.js and Deno SDK for managing your Neon Serverless Postgres projects.
Note
Neon is a fully managed serverless PostgreSQL with a generous free tier. Neon separates storage and compute and offers modern developer features such as serverless, branching, bottomless storage, and more. Neon is open source and written in Rust.
Install neon-sdk
as a dependency using the package manager of your choice.
npm i neon-sdk
Initialize the client with your Neon API token.
import { NeonClient } from 'neon-sdk';
const neonClient = new NeonClient({
TOKEN: '<INSERT NEON API KEY HERE>',
});
(async () => {
const projects = await neonClient.project.listProjects();
console.log(projects);
})()
Add the neon-sdk
package from JSR.
deno add @httgp/neon-sdk
Now import the module and initialize the client with your Neon API token.
import { NeonClient } from "@httgp/neon-sdk";
const neonClient = new NeonClient({
TOKEN: "<INSERT NEON API KEY HERE>",
});
const projects = await neonClient.project.listProjects();
console.log(projects);
Make sure to allow net
permissions to console.neon.tech
for the code to run.
deno run --allow-net=console.neon.tech neon.ts
Alternatively, the neon-sdk
package is also available from npm, which can be used with the npm:
specifier.
import { NeonClient } from "npm:neon-sdk";
const neonClient = new NeonClient({
TOKEN: "<INSERT NEON API KEY HERE>",
});
const projects = await neonClient.project.listProjects();
console.log(projects);
All API responses are typed as a union of the specific API's successful response and GeneralError
. To narrow this type down –
import { NeonClient, type GeneralError } from 'neon-sdk';
function isNeonError(neonResponse: unknown): neonResponse is GeneralError {
const allowedKeys = ['code', 'message'].sort();
const foundKeys = Object.getOwnPropertyNames(neonResponse || {}).sort();
return foundKeys.length === allowedKeys.length
&& foundKeys.every((value, index) => value === allowedKeys[index])
&& (neonResponse as GeneralError).code !== undefined
&& (neonResponse as GeneralError).message !== undefined;
}
const neonClient = new NeonClient({
TOKEN: '<INSERT NEON API KEY HERE>',
});
const response = await neonClient.project.listProjects();
if (!isNeonError(response)) {
// Correctly typed as `ProjectsResponse`
response
}
This package is auto-generated from Neon's OpenAPI reference using @hey-api/openapi-ts
.
FAQs
TypeScript SDK for managing your Neon Serverless PostgreSQL projects
The npm package neon-sdk receives a total of 211 weekly downloads. As such, neon-sdk popularity was classified as not popular.
We found that neon-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.