@oneclient/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/index.d.ts +846 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +648 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @oneclient/sdk
|
|
2
|
+
|
|
3
|
+
The typed client behind OneClient. It covers project auth, policy-controlled data, parameterized
|
|
4
|
+
SQL, object storage and S3 multipart uploads, KV, queues and schedules, transactional email,
|
|
5
|
+
managed/BYOK AI, product analytics, deployments, domains, billing, GitHub, and recovery workflows.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @oneclient/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { createServerClient } from "@oneclient/sdk";
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
async fetch(_request: Request, env: Env) {
|
|
16
|
+
const one = createServerClient(env);
|
|
17
|
+
await one.analytics.track([
|
|
18
|
+
{ name: "workspace.created", occurredAt: new Date().toISOString(), properties: {} },
|
|
19
|
+
]);
|
|
20
|
+
return Response.json(await one.kv.get("release-flags"));
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
For the SDK and CLI in one install, use [`oneclient`](https://www.npmjs.com/package/oneclient). Read
|
|
26
|
+
the [five-minute quickstart](https://one-client.com/docs/quickstart) or the
|
|
27
|
+
[generated API reference](https://console.one-client.com/api-reference).
|