# SDKs & hostile runtimes

For most stacks (Python, Go, Rails, PHP, bash) **the curl example is the
SDK**: one HTTP call, done. See the [Quickstart](/docs/quickstart). SDKs
exist only where the runtime actively fights the simple path. There is one
per execution model, and each solves a specific way the naive
fire-and-forget `fetch` gets dropped.

| Package | Runtime | The problem it solves |
|---|---|---|
| [`@datagauge/edge`](/docs/sdks/edge) | Serverless & edge (Workers, Vercel, Deno, Lambda) | The runtime freezes the instant your response returns. |
| [`@datagauge/convex`](/docs/sdks/convex) | Convex | Mutations can't `fetch()`. |
| [`@datagauge/client`](/docs/sdks/client) | Client & offline (Expo, Electron, PWAs) | Devices go offline and apps get killed mid-session. |
| [`@datagauge/node`](/docs/sdks/node) | Short-lived CLIs, cron jobs, scripts | The process exits before any background batcher fires. |

## Installing

```sh
npm install @datagauge/<runtime>   # edge | convex | client | node
```

Or skip the dependency entirely: every SDK is a **single dependency-free
TypeScript file**, and vendoring it is a supported install, not a
workaround.

```sh
# pick your runtime: edge | convex | client | node
curl -o lib/datagauge.ts \
  https://raw.githubusercontent.com/raymond-UI/datagauge/main/sdks/edge/index.ts
```

## A note on keys

Server SDKs (`edge`, `convex`, `node`) send with an `sk_live_` key and can
write payments and subscriptions. The `client` SDK is built to ship inside
binaries, so it uses a public `pk_live_` key that **can never write
money**; see [Keys & scoping](/docs/concepts/keys). Every prefix has an
`sk_test_` / `pk_test_` twin that writes to an isolated test environment;
swap the prefix to rehearse before going live.
