@thingd/client 0.70.0 → 0.72.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 +23 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,29 @@ const client = new ThingdClient({
|
|
|
36
36
|
});
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
### Mobile and web app backends
|
|
40
|
+
|
|
41
|
+
Use the app client for a project-user backend. It works with browsers,
|
|
42
|
+
React Native/Expo, Node.js, and other runtimes with `fetch`:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { createThingdAppClient } from "@thingd/client";
|
|
46
|
+
|
|
47
|
+
const app = createThingdAppClient({
|
|
48
|
+
baseUrl: "https://api.thingd.cloud",
|
|
49
|
+
publishableKey: "pk_...",
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
await app.auth.signUp({ email, password, name });
|
|
53
|
+
const profile = await app.functions.invoke("createProfile", { timezone: "UTC" }, {
|
|
54
|
+
idempotencyKey: "profile:create:user-1",
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The publishable key is safe for app bundles. Do not use a secret Cloud API key
|
|
59
|
+
or engine runtime token in a browser or mobile application. See
|
|
60
|
+
`docs/app-backend.md` for the public contract.
|
|
61
|
+
|
|
39
62
|
### Objects
|
|
40
63
|
|
|
41
64
|
```ts
|