@palettelab/sdk 0.1.27 → 0.1.29
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 +14 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@ Frontend SDK for building Palette plugins and internal apps.
|
|
|
4
4
|
|
|
5
5
|
Use this package from plugin frontends created with `@palettelab/cli`. It provides typed platform context, authenticated API helpers, React hooks for common Palette resources, iframe sandbox bridge helpers, install configuration helpers, and test utilities.
|
|
6
6
|
|
|
7
|
+
Use `@palettelab/sdk` only from frontend TypeScript/React code. Python backend
|
|
8
|
+
routes should use `palette_sdk` through `PluginContext` and `ctx.*` helpers; the
|
|
9
|
+
CLI bundles that backend SDK for local simulation and generated backend apps.
|
|
10
|
+
|
|
7
11
|
## Install
|
|
8
12
|
|
|
9
13
|
```bash
|
|
@@ -506,11 +510,12 @@ const file = folder
|
|
|
506
510
|
: null
|
|
507
511
|
```
|
|
508
512
|
|
|
509
|
-
## OS Notifications
|
|
513
|
+
## Frontend OS Notifications
|
|
510
514
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
515
|
+
Use the frontend TypeScript SDK to push a persistent notification into the OS
|
|
516
|
+
notification center (the bell) for the current signed-in user. Unlike a toast,
|
|
517
|
+
it survives past the moment, shows your app's icon and name, and opens/focuses
|
|
518
|
+
your app window when clicked:
|
|
514
519
|
|
|
515
520
|
```ts
|
|
516
521
|
import { notifications } from "@palettelab/sdk"
|
|
@@ -531,10 +536,11 @@ opens by default. `route` is optional; when present it resolves inside the
|
|
|
531
536
|
target app. The source app id is inferred from the URL — pass `appId` to
|
|
532
537
|
override.
|
|
533
538
|
|
|
534
|
-
Use the SDK helper rather than hand-building platform notification API
|
|
535
|
-
Frontend notifications target the calling user and their active
|
|
536
|
-
are delivered live to the OS shell, and show as a toast plus a
|
|
537
|
-
notification-center entry. Use
|
|
539
|
+
Use the frontend SDK helper rather than hand-building platform notification API
|
|
540
|
+
calls. Frontend notifications target the calling user and their active
|
|
541
|
+
organisation, are delivered live to the OS shell, and show as a toast plus a
|
|
542
|
+
notification-center entry. Use the Python backend helper
|
|
543
|
+
`ctx.notifications.push(...)` from `palette_sdk` for cross-user notifications.
|
|
538
544
|
|
|
539
545
|
## Permissions
|
|
540
546
|
|