@abloatai/ablo 0.50.0 → 0.51.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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.51.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3a25ab4: Default cross-organization user sessions to the platform key's schema project.
8
+ Customer data remains isolated in the target organization, while one pushed
9
+ schema can describe every customer tenant. `sessions.create` also accepts an
10
+ explicit `schemaProject` override for migrations and advanced routing.
11
+
12
+ The sessions guide now distinguishes policy-scoped customers from structurally
13
+ isolated customer organizations and makes clear that sync-group routing is not
14
+ read authorization.
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [3a25ab4]
19
+ - @abloatai/transaction@0.51.0
20
+ - @abloatai/humans@0.51.0
21
+
3
22
  ## 0.50.0
4
23
 
5
24
  ### Context can travel from reads to a model and back to a write
package/docs/sessions.md CHANGED
@@ -243,25 +243,37 @@ Some apps need each customer to be its **own** tenant — a hard data boundary
243
243
  scoping. The law-firm shape (Legora): every firm is its own org, many users
244
244
  inside it.
245
245
 
246
+ Choose the boundary before minting sessions:
247
+
248
+ | Customer model | Isolation guarantee | Use when |
249
+ |---|---|---|
250
+ | One Ablo organization, customer scope roots | Every model's declared `policy` | Cross-customer access is intentional or every model explicitly partitions by the customer root |
251
+ | One Ablo organization per customer | Structural organization filtering and RLS on every row | Customers must be isolated even when a model has no customer policy |
252
+
253
+ Sync-group routing controls which changes are delivered; it does not grant or
254
+ deny reads. Do not use scope roots as a tenant security boundary unless every
255
+ model declares the matching policy. If that invariant is difficult to audit,
256
+ use one organization per customer.
257
+
246
258
  The problem that creates: if each customer is a separate org, a naïve setup would
247
259
  make you re-push your schema into every new customer's org. You don't have to.
248
- Keep **one** project as the home of your schema, and point each customer's
249
- session's *schema* at it while its *data* stays in the customer's own org:
260
+ Keep **one** project as the home of your schema. When its key mints into another
261
+ organization, Ablo automatically resolves the session's *schema* from that key's
262
+ project while its *data* stays in the customer's own org:
250
263
 
251
264
  ```ts
252
- const { token } = await mintUserSessionKey({
253
- apiKey: process.env.ABLO_PLATFORM_KEY, // sk_ with the ephemeral:mint-any-org scope
254
- userId,
255
- organizationId, // DATA → this customer's org (its own isolated tenant)
256
- schemaProject: { // SCHEMA the project that owns your schema
257
- organizationId: schemaOwnerOrgId,
258
- projectId: schemaProjectId,
259
- },
260
- operations: ['task.read', 'task.update'],
265
+ const ablo = Ablo({ schema, apiKey: process.env.ABLO_PLATFORM_KEY });
266
+ const { token } = await ablo.sessions.create({
267
+ user: { id: userId },
268
+ organizationId, // DATA → this customer's isolated org
269
+ can: { tasks: ['read', 'update'] },
261
270
  ttlSeconds: 3600,
262
271
  });
263
272
  ```
264
273
 
274
+ For migrations or advanced routing, `sessions.create` also accepts an explicit
275
+ `schemaProject: { organizationId, projectId }` override.
276
+
265
277
  Server-side the split is clean: the model **shape** loads from your schema
266
278
  project, but column enrichment and the tenant connection target the customer's
267
279
  `organizationId` — so the shared schema only *describes* the shape; the data
@@ -270,9 +282,9 @@ can't leak data across orgs.
270
282
 
271
283
  <Note>
272
284
  This requires a platform `sk_` carrying the `ephemeral:mint-any-org` scope —
273
- only a trusted first-party key can mint a session into another org and bind its
274
- schema to your project. Omit these fields and you get the default above: one
275
- project, one schema, all your users.
285
+ only a trusted platform key can mint a session into another org. Omit
286
+ `organizationId` and you get the default above: one project, one schema, all
287
+ your users in the key's own organization.
276
288
  </Note>
277
289
 
278
290
  ## Security
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abloatai/ablo",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "The public Ablo SDK for coordinated reads, commits, claims, observation, and reactive applications.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -137,8 +137,8 @@
137
137
  "directory": "packages/ablo"
138
138
  },
139
139
  "dependencies": {
140
- "@abloatai/humans": "^0.50.0",
141
- "@abloatai/transaction": "^0.50.0",
140
+ "@abloatai/humans": "^0.51.0",
141
+ "@abloatai/transaction": "^0.51.0",
142
142
  "zod": "^4.4.3"
143
143
  },
144
144
  "peerDependencies": {