@collective-intelligence/external-apps-client-sdk-react 0.12.0 → 0.13.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/docs/guide/develop/sdks.md +34 -16
- package/docs/guide/platform/entrypoints.md +13 -11
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Which @collective-intelligence package to import, from which subpath, with which Effect setup and which versions.
|
|
4
4
|
|
|
5
|
-
The SDK family splits by where your code runs. Code that you install into CI as part of a package uses the `@collective-intelligence/extensions-sdk*` packages. Code that you host yourself, such as a Next.js web app and its BFF, uses the `@collective-intelligence/external-apps-*` packages.
|
|
5
|
+
The SDK family splits by where your code runs. Code that you install into CI as part of a package uses the `@collective-intelligence/extensions-sdk*` packages. Code that you host yourself, such as a Next.js web app and its BFF, uses the `@collective-intelligence/external-apps-*` packages. A self-hosted content system, such as a Payload Site, uses a CMS SDK of that family.
|
|
6
6
|
|
|
7
7
|
The template keeps the families apart. Package code imports only `extensions-sdk*` and `ui-react`, browser code imports the client SDK, and confidential server code imports the server SDK.
|
|
8
8
|
|
|
@@ -38,19 +38,21 @@ The right side is `apps/web`. Its browser code talks to its own server through a
|
|
|
38
38
|
|
|
39
39
|
## The packages
|
|
40
40
|
|
|
41
|
-
| Package
|
|
42
|
-
|
|
|
43
|
-
| `@collective-intelligence/extensions-sdk`
|
|
44
|
-
| `@collective-intelligence/extensions-sdk-backend`
|
|
45
|
-
| `@collective-intelligence/extensions-sdk-frontend`
|
|
46
|
-
| `@collective-intelligence/extensions-sdk-frontend-react`
|
|
47
|
-
| `@collective-intelligence/external-apps-client-sdk`
|
|
48
|
-
| `@collective-intelligence/external-apps-client-sdk-react`
|
|
49
|
-
| `@collective-intelligence/external-apps-server-sdk`
|
|
50
|
-
| `@collective-intelligence/
|
|
51
|
-
| `@collective-intelligence/
|
|
52
|
-
| `@collective-intelligence/
|
|
53
|
-
| `@collective-intelligence/
|
|
41
|
+
| Package | Runs where | Main subpaths | Use it for |
|
|
42
|
+
| ----------------------------------------------------------- | ------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `@collective-intelligence/extensions-sdk` | Package build | `.`, `/effect` (empty) | Declare the package and its components with `declarePackage` and the other `declare*` functions |
|
|
44
|
+
| `@collective-intelligence/extensions-sdk-backend` | Inside CI, backend | `.`, `/effect` | Implement the code that tools, connectors and dataset providers run |
|
|
45
|
+
| `@collective-intelligence/extensions-sdk-frontend` | Inside CI, Studio and Dashboard | `.`, `/effect` (empty) | Declare the frontend catalog that a Host loads through `loadFrontendCatalog` |
|
|
46
|
+
| `@collective-intelligence/extensions-sdk-frontend-react` | Inside CI, Studio and Dashboard | `/studio`, `/studio-api`, `/dashboard`, `/workflow`, `/ui-react`, `/effect` | Write the React code of a Studio widget or Dashboard contribution |
|
|
47
|
+
| `@collective-intelligence/external-apps-client-sdk` | Your app, browser | `.`, `/resources`, `/effect` | Sign users in with CI and call CI operations without React |
|
|
48
|
+
| `@collective-intelligence/external-apps-client-sdk-react` | Your app, browser | `.`, `/resources`, `/effect` | Providers and entity hooks that read and write CI records |
|
|
49
|
+
| `@collective-intelligence/external-apps-server-sdk` | Your app, server only | `.`, `/auth/federated`, `/effect`, `/next`, `/admin` | BFF routes, sign-in and confidential calls to CI |
|
|
50
|
+
| `@collective-intelligence/external-apps-server-sdk-payload` | Your Payload Site, server only | `.`, `/package`, `/ci-generate` | Connect a Payload Site to CI: the Payload Plugin, and helpers for the site's CI package |
|
|
51
|
+
| `@collective-intelligence/external-apps-server-sdk-strapi` | Your Strapi 5 site, server only | `.` | Serve the documents of a Strapi 5 site to CI through a Gateway |
|
|
52
|
+
| `@collective-intelligence/ui-react` | Both sides | `/ui`, `/resources`, `/icons`, `/hooks`, `/tokens/theme` | CI design-system components that take display-ready props |
|
|
53
|
+
| `@collective-intelligence/cli` | Your machine or pipeline | `ci` binary | Sign in, build and deploy packages, enroll an app |
|
|
54
|
+
| `@collective-intelligence/lint` | Development | `recommended` | Oxlint rules that keep the solution layout and Effect imports correct |
|
|
55
|
+
| `@collective-intelligence/schema-codegen` | Development | `.` | Generate TypeScript, Zod or Effect Schema source from package schemas |
|
|
54
56
|
|
|
55
57
|
You rarely import `schema-codegen` yourself, because `ci package codegen --target zod|effect|types` calls it for you. Generated schemas describe the wire shape only, and the CI backend still validates every payload.
|
|
56
58
|
|
|
@@ -154,9 +156,22 @@ handlers: createExternalApplicationBffNextHandlers({
|
|
|
154
156
|
|
|
155
157
|
[External apps](external-apps.md) covers sign-in, the BFF and fixed workflow routes in detail.
|
|
156
158
|
|
|
159
|
+
### CMS SDKs for a self-hosted content system
|
|
160
|
+
|
|
161
|
+
A CMS SDK connects a self-hosted content system to CI. It serves the site's content through a Gateway, and CI reads it with its one built-in Knowledge Gateway connector, so CI needs no code for your content system. A CMS SDK depends on `external-apps-server-sdk` at the exact same version: install no other server SDK version next to it.
|
|
162
|
+
|
|
163
|
+
| Package | Subpath | What you get |
|
|
164
|
+
| ---------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
165
|
+
| `external-apps-server-sdk-payload` | `.` | `ciPayloadPlugin`, the Payload Plugin that serves the chosen collections and pushes each change |
|
|
166
|
+
| `external-apps-server-sdk-payload` | `/package` | The Payload Package Helpers `payloadGateway`, `payloadKnowledge`, `payloadGatewayPushGrant`, `payloadPageEditor`, `payloadPackageDependencies` and `payloadOperationContract`, for the site's CI package; it loads no Payload module |
|
|
167
|
+
| `external-apps-server-sdk-payload` | `/ci-generate` | The `payload ci-generate` command that the plugin adds; Payload loads it, so you do not import it |
|
|
168
|
+
| `external-apps-server-sdk-strapi` | `.` | `defineStrapiSource` and `defineStrapiGatewayPlugin`, which turn a Strapi Document Service into a Gateway resource |
|
|
169
|
+
|
|
170
|
+
The Payload SDK takes `extensions-sdk` as a peer at the exact version, so the helpers and your CI package share one copy. A hosted service, such as Notion, needs no CMS SDK: CI connects it with a built-in integration package.
|
|
171
|
+
|
|
157
172
|
## Effect
|
|
158
173
|
|
|
159
|
-
`effect` `^4.1.0` is a required peer of `extensions-sdk`, `extensions-sdk-backend`, both frontend extension packages and the
|
|
174
|
+
`effect` `^4.1.0` is a required peer of `extensions-sdk`, `extensions-sdk-backend`, both frontend extension packages, the client SDK, the client React SDK, the server SDK and the Payload SDK. The Strapi SDK needs it through the server SDK. The SDKs do not bundle it, so install it in your app and keep one version across the workspace.
|
|
160
175
|
|
|
161
176
|
Effect APIs always come from a `/effect` subpath, and the lint rule `effect-subpath` reports an Effect import from anywhere else.
|
|
162
177
|
|
|
@@ -206,7 +221,8 @@ Some names from older examples no longer exist. An old server SDK subpath fails
|
|
|
206
221
|
| `external-apps-server-sdk/runtime/effect` | `external-apps-server-sdk/effect` |
|
|
207
222
|
| `external-apps-server-sdk/persistence/drizzle/effect` | `external-apps-server-sdk/effect` plus `/effect/node-postgres` |
|
|
208
223
|
| `external-apps-server-sdk/runtime/next` | `external-apps-server-sdk/next` |
|
|
209
|
-
| `external-apps-server-sdk/knowledge-sources/payload` | `ciPayloadPlugin` from `external-apps-server-sdk
|
|
224
|
+
| `external-apps-server-sdk/knowledge-sources/payload` | `ciPayloadPlugin` from `external-apps-server-sdk-payload`, which serves the site's collections as a Gateway |
|
|
225
|
+
| `external-apps-server-sdk/knowledge-sources/strapi` | `external-apps-server-sdk-strapi`; take the resource types from `external-apps-server-sdk/resources` |
|
|
210
226
|
|
|
211
227
|
The two removed packages stopped at version 0.2.0, and npm marks them deprecated.
|
|
212
228
|
|
|
@@ -219,6 +235,8 @@ The two removed packages stopped at version 0.2.0, and npm marks them deprecated
|
|
|
219
235
|
| Render a custom widget in Studio | `extensions-sdk-frontend` for the catalog and `extensions-sdk-frontend-react` (`/studio`, `/studio-api`) |
|
|
220
236
|
| Sign users in with CI and proxy record reads and writes from a Next.js server | `external-apps-server-sdk` (`/auth/federated`, `/next`) |
|
|
221
237
|
| Call CI from server code with the application's credentials | `external-apps-server-sdk` root or `/effect` |
|
|
238
|
+
| Connect a Payload Site to CI | `external-apps-server-sdk-payload`, with `/package` in the site's CI package |
|
|
239
|
+
| Connect a Strapi 5 site to CI | `external-apps-server-sdk-strapi` |
|
|
222
240
|
| Show and edit CI records on a browser page | `external-apps-client-sdk-react` (`/resources`) |
|
|
223
241
|
| Call CI from a browser without React | `external-apps-client-sdk` |
|
|
224
242
|
| Reuse CI design-system components | `ui-react` |
|
|
@@ -256,17 +256,19 @@ Code in the template imports CI packages and its own workspaces by package name
|
|
|
256
256
|
|
|
257
257
|
The SDKs split by where the code runs. [SDKs](../develop/sdks.md) has the full map; these are the subpaths you meet most.
|
|
258
258
|
|
|
259
|
-
| Package
|
|
260
|
-
|
|
|
261
|
-
| `@collective-intelligence/extensions-sdk`
|
|
262
|
-
| `@collective-intelligence/extensions-sdk-backend`
|
|
263
|
-
| `@collective-intelligence/extensions-sdk-frontend`
|
|
264
|
-
| `@collective-intelligence/extensions-sdk-frontend-react`
|
|
265
|
-
| `@collective-intelligence/external-apps-server-sdk`
|
|
266
|
-
| `@collective-intelligence/external-apps-
|
|
267
|
-
| `@collective-intelligence/external-apps-
|
|
268
|
-
|
|
269
|
-
|
|
259
|
+
| Package | Runs | Holds | Main subpaths |
|
|
260
|
+
| ----------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------ | ---------------------------------------------------------- |
|
|
261
|
+
| `@collective-intelligence/extensions-sdk` | Inside CI | Declarations such as `declarePackage`, `declareAgent`, `declareWorkflow` | `.`, `./effect` |
|
|
262
|
+
| `@collective-intelligence/extensions-sdk-backend` | Inside CI | Contracts for backend tools and connectors | `.`, `./effect` |
|
|
263
|
+
| `@collective-intelligence/extensions-sdk-frontend` | Inside CI | Framework-neutral frontend catalog | `.`, `./effect` |
|
|
264
|
+
| `@collective-intelligence/extensions-sdk-frontend-react` | Inside CI | React bindings for Studio and Dashboard contributions | `./studio`, `./dashboard`, `./studio-api`, `./effect` |
|
|
265
|
+
| `@collective-intelligence/external-apps-server-sdk` | Your server | Server client, BFF, authentication, Gateway | `.`, `./auth/federated`, `./effect`, `./next`, `./gateway` |
|
|
266
|
+
| `@collective-intelligence/external-apps-server-sdk-payload` | Your Payload Site | Payload Plugin, Payload Package Helpers, `payload ci-generate` | `.`, `./package`, `./ci-generate` |
|
|
267
|
+
| `@collective-intelligence/external-apps-server-sdk-strapi` | Your Strapi 5 site | Strapi 5 adapter that serves documents through a Gateway | `.` |
|
|
268
|
+
| `@collective-intelligence/external-apps-client-sdk` | Your browser | React-free client and Realtime | `.`, `./resources`, `./effect` |
|
|
269
|
+
| `@collective-intelligence/external-apps-client-sdk-react` | Your browser | React hooks, including the entity hooks in `./resources` | `.`, `./resources`, `./effect` |
|
|
270
|
+
|
|
271
|
+
Every SDK puts its Promise API at the root and its Effect services, Layers, errors and Schemas at `/effect`; the two CMS SDKs, the Payload SDK and the Strapi SDK, have no `/effect`. `effect` is a required peer of every SDK (the Strapi SDK gets it through the server SDK), so install it next to the SDK and keep one `effect` version in the app. Optional peers such as Next.js, Express, Drizzle, Better Auth and the AI SDK sit behind their own subpaths, so importing the server SDK root never loads them. In the template, `/next` is imported only inside `apps/web/src/server`, because `/next` loads Next.js and `/effect` does not.
|
|
270
272
|
|
|
271
273
|
### Template domain parts
|
|
272
274
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@collective-intelligence/external-apps-client-sdk-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "React bindings for Collective Intelligence external applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"type-check": "bun check --no-script -p tsconfig.json"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@collective-intelligence/effect-xstate": "0.
|
|
69
|
-
"@collective-intelligence/external-apps-client-sdk": "0.
|
|
68
|
+
"@collective-intelligence/effect-xstate": "0.13.0",
|
|
69
|
+
"@collective-intelligence/external-apps-client-sdk": "0.13.0",
|
|
70
70
|
"nuqs": "2.10.1"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@collective-intelligence/ui-react": "0.
|
|
73
|
+
"@collective-intelligence/ui-react": "0.13.0",
|
|
74
74
|
"@tanstack/db": "1.0.0-rc.1.5",
|
|
75
75
|
"@tanstack/offline-transactions": "1.2.1",
|
|
76
76
|
"@tanstack/query-core": "^5.101.4",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@collective-intelligence/ui-react": "0.
|
|
89
|
+
"@collective-intelligence/ui-react": "0.13.0",
|
|
90
90
|
"@effect/eslint-plugin": "0.3.2",
|
|
91
91
|
"@oxlint/plugins": "1.94.0",
|
|
92
92
|
"@punks/lints": "0.2.0",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"vitest": "4.1.10",
|
|
120
120
|
"xstate": "5.33.3"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "d3e93c4287307c474b0bf32c386a1471fe67ce2c"
|
|
123
123
|
}
|