VSKI SDK
  • TypeScript 99.6%
  • Shell 0.4%
Find a file
2026-03-02 19:31:16 +01:00
.zed [0.0.5] docs, missing types, cleanups 2026-01-22 23:58:37 +01:00
cmd fix: make cli non-iteractive 2026-03-02 19:27:17 +01:00
dist fix: make cli non-iteractive 2026-03-02 19:27:17 +01:00
docs [chore] add binary dist and getting started docs 2026-01-30 10:32:19 +01:00
src v2.0.3: add method for replicas 2026-02-26 16:22:07 +01:00
.env.example [chore] add binary dist and getting started docs 2026-01-30 10:32:19 +01:00
.gitattributes [chore] add binary dist and getting started docs 2026-01-30 10:32:19 +01:00
.gitignore [chore] add binary dist and getting started docs 2026-01-30 10:32:19 +01:00
.npmrc refactor: fix domain 2026-03-02 18:19:41 +01:00
AGENTS.md refactor: cli 2026-03-02 18:16:48 +01:00
build.ts fix: build 2026-03-02 19:31:16 +01:00
deno.json refactor: cli 2026-03-02 18:16:15 +01:00
deno.lock refactor: cli 2026-03-02 18:16:15 +01:00
exports.ts chore: cleanups 2026-02-15 11:33:54 +01:00
LICENSE [init] rocketbase sdk 2026-01-19 22:36:05 +01:00
package.json v2.0.3: add method for replicas 2026-02-26 16:21:41 +01:00
README.md refactor: cli 2026-03-02 18:16:15 +01:00
TODO.md refactor: cli 2026-03-02 18:16:48 +01:00
tsconfig.json [init] rocketbase sdk 2026-01-19 22:36:05 +01:00

@vski/sdk

A runtime-agnostic TypeScript SDK for the VSKI RocketBase platform.

Features

  • Database operations (CRUD, bulk operations)
  • Realtime subscriptions via WebSocket
  • Durable workflows with retries and signals
  • Authentication (users and admins)
  • Schema migrations
  • CLI tool for database management

Installation

npm install @vski/sdk --registry=https://vski.sh/api/packages/x/npm/

Or configure .npmrc:

@vski:registry=https://vski.sh/api/packages/x/npm/

Then:

npm install @vski/sdk

Quick Start

import { VskiClient } from "@vski/sdk";

const client = new VskiClient("http://localhost:3001");

// Authenticate
await client.admins.authWithPassword("admin@example.com", "password");

Database Operations

const posts = client.collection("posts");

// Create
const record = await posts.create({ title: "Hello", content: "World" });

// List with filter
const { items } = await posts.getList(1, 30, {
  filter: 'status = "published"',
  expand: "author",
});

// Update
await posts.update(record.id, { status: "published" });

// Delete
await posts.delete(record.id);

// Bulk
await posts.bulkUpdate(["id1", "id2"], { status: "archived" });

Realtime

const unsub = client.collection("messages").subscribe((event) => {
  console.log(event.action, event.record);
});

unsub();

Durable Workflows

Functional Style

import { step, workflow } from "@vski/sdk";

const notify = step("notify", async (email: string) => {
  return await sendEmail(email, "Welcome!");
});

workflow("welcome").run(async (ctx, email: string) => {
  await ctx.sleep("1h");
  await notify(email);
  const signal = await ctx.waitForSignal("confirm");
  return { confirmed: signal.success };
});

Class-Based Style

import { Step, Workflow, WorkflowBase } from "@vski/sdk";

@Workflow("order")
class OrderWorkflow extends WorkflowBase {
  @Step("pay", { retries: 3 })
  async pay(amount: number) {
    return await stripe.charge(amount);
  }

  async run(orderId: string, amount: number) {
    await this.pay(amount);
  }
}

Worker

import { WorkflowWorker } from "@vski/sdk";

const worker = new WorkflowWorker(client);
await worker.start("welcome");

Trigger

const run = await client.workflow.trigger("welcome", ["user@example.com"]);
await client.workflow.sendSignal(run.runId, "confirm", { success: true });

CLI

deno install --global -A -n vski cmd/cli/main.ts

Commands:

vski login                  # Log in as admin
vski db list               # List databases
vski db create <name>      # Create database
vski db delete <name>      # Delete database
vski db generate           # Generate migration from schema
vski migrate <file>        # Run migrations
vski migrations            # List applied migrations
vski status                # Migration status

Tests & Coverage

Tests and coverage are available in the parent repository: https://vski.sh/x/platform

License

VSKI License - Copyright (c) 2025 Anton A Nesterov