@upstash/sdk

v0.0.30-alpha
An umbrella SDK for all other Upstash SDKs
vector upstash db redis kafka serverless

Upstash SDK Node.js Client · license Tests npm (scoped) npm bundle size npm weekly download

@upstash/sdk is an umbrella HTTP/REST based client for Typescript, built on top of other Upstash products and SDKs.

Quick Start

Install

Node.js

npm install @upstash/sdk

Basic Usage:

const client = new Upstash({
  email: "[email protected]",
  token: "developer-token",
});

//OR

//If you have your env keys already in your .env file, you don't have to pass them explicitly
const client = new Upstash();

//VECTOR SDK
const createRes = await client.createVectorIndex({
  name: "uptash-rocks",
  region: "eu-west-1",
  dimension_count: 2,
  similarity_function: "COSINE",
  type: "fixed",
});

const index = await client.newVectorClient(createRes.id);
await index.info();

const indexes = await client.listVectorIndexes();

await client.deleteVectorIndex(createRes.id);

//REDIS SDK
const createRes = await client.createRedisDatabase({
  name: "uptash-rocks",
  region: "eu-central-1",
  tls: true,
});

const redis = await client.newRedisClient(createRes.database_name);
await redis.incr("hut-two-three-four");

const dbs = await client.listRedisDatabases();

await client.deleteRedisDatabase(createRes.database_name);

//QSTASH SDK
const { client, receiver } = await client.newQStashClient();
await qstashClient.publishJSON();
await qstashReceiver.verify();

Troubleshooting

We have a Discord for common problems. If you can't find a solution, please open an issue.

Docs

See the documentation for details.

Contributing

Install Bun

Running tests

bun run test

Building

bun run build
npm i @upstash/sdk

Metadata

  • MIT
  • Whatever
  • Oguzhan Olguncu
  • released 5/6/2024

Downloads