Developer

SDK Primitives

The ctx.sdk.* surface - HTTP, storage, OAuth, events, cron, and platform access, each gated by a declared scope.

Inside a method’s run, the ctx argument carries the SDK. The typed surfaces - entities, methods, events - are the preferred way to do work. ctx.sdk.* is the primitive surface beneath them: HTTP, OAuth, storage, scheduling, and platform access. Every call is gated by a scope declared in applet.json.

async run(params, ctx) {
  const res = await ctx.sdk.http.request({ url, signal: ctx.signal });
  await ctx.sdk.kv.set("last-sync", ctx.now());
  // ...
}

The canonical reference for this surface is apps/rightplace-applet-sdk/API.md section 6.1. These pages render it.

Network

  • HTTP - outbound requests, streaming, authenticated and paginated helpers
  • OAuth - Authorization Code flow with optional PKCE
  • WebSocket - persistent connections
  • Relay - peer-to-peer channels

Data

Scheduling & events

Platform & discovery

Preferred order

  1. Entities, methods, events - typed, validated, lint-clean.
  2. ctx.sdk.* primitives - when you need a capability the typed surfaces do not cover.
  3. Raw escape hatches (ctx.sdk.invoke) - discouraged; the linter warns.