@softr/sdk 0.0.87 → 0.0.88

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.
Files changed (34) hide show
  1. package/dist/auth/isomorphic.d.ts +3 -2
  2. package/dist/auth/isomorphic.js +4 -1
  3. package/dist/auth/methods/authenticator.js +3 -3
  4. package/dist/auth/methods/code.js +1 -1
  5. package/dist/auth/methods/magicLink.js +1 -1
  6. package/dist/auth/methods/password.js +1 -1
  7. package/dist/auth/methods/passwordLink.js +1 -1
  8. package/dist/auth/methods/signup.js +1 -1
  9. package/dist/auth/methods/social.js +1 -1
  10. package/dist/auth/platform.js +1 -1
  11. package/dist/auth/session.js +8 -7
  12. package/dist/cookies.js +29 -3
  13. package/dist/embedding.js +33 -0
  14. package/dist/mcp.d.ts +2 -2
  15. package/dist/mcp.js +1 -1
  16. package/dist/package.js +1 -1
  17. package/dist/route/route.js +1 -1
  18. package/dist/softr-config.schema.js +3 -1
  19. package/package.json +1 -1
  20. package/schema/softr.schema.json +5 -0
  21. package/skills/softr-sdk/SKILL.md +8 -3
  22. package/skills/softr-sdk/auth/SKILL.md +1 -1
  23. package/skills/softr-sdk/charts-and-metrics/SKILL.md +1 -1
  24. package/skills/softr-sdk/current-user/SKILL.md +1 -1
  25. package/skills/softr-sdk/file-uploads/SKILL.md +1 -1
  26. package/skills/softr-sdk/formatting/SKILL.md +1 -1
  27. package/skills/softr-sdk/integrations/SKILL.md +1 -1
  28. package/skills/softr-sdk/mcp/SKILL.md +1 -1
  29. package/skills/softr-sdk/pwa/SKILL.md +1 -1
  30. package/skills/softr-sdk/record-mutations/SKILL.md +1 -1
  31. package/skills/softr-sdk/record-queries/SKILL.md +1 -1
  32. package/skills/softr-sdk/region-visibility/SKILL.md +1 -1
  33. package/skills/softr-sdk/routes-and-visibility/SKILL.md +1 -1
  34. package/skills/softr-sdk/workflows/SKILL.md +1 -1
@@ -14,14 +14,15 @@ import * as _tanstack_react_start0 from "@tanstack/react-start";
14
14
  * to read.
15
15
  *
16
16
  * Register it once, as a global request middleware in the app's `src/start.ts`.
17
- * It writes nothing but the session cookie.
17
+ * It writes the session cookie, and in production a header that stops other
18
+ * sites from embedding the app.
18
19
  *
19
20
  * @example
20
21
  * export const startInstance = createStart(() => ({
21
22
  * requestMiddleware: [softrAuthMiddleware()],
22
23
  * }))
23
24
  */
24
- declare function softrAuthMiddleware(): _tanstack_react_start0.RequestMiddlewareAfterServer<{}, readonly [_tanstack_react_start0.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start0.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start0.RequestMiddlewareAfterServer<{}, undefined, undefined>], {
25
+ declare function softrAuthMiddleware(): _tanstack_react_start0.RequestMiddlewareAfterServer<{}, readonly [_tanstack_react_start0.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start0.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start0.RequestMiddlewareAfterServer<{}, undefined, undefined>, _tanstack_react_start0.RequestMiddlewareAfterServer<{}, undefined, undefined>], {
25
26
  user: User | null;
26
27
  permissions: Permissions;
27
28
  formatting: Formatting;
@@ -9,6 +9,7 @@ import { settings } from "./methods/settings.js";
9
9
  import { bootErrorMiddleware } from "../boot-error.js";
10
10
  import { pwaMiddleware } from "../pwa.js";
11
11
  import { faviconMiddleware } from "../favicon.js";
12
+ import { embeddingMiddleware } from "../embedding.js";
12
13
  import { createContext, useContext } from "react";
13
14
  import { createMiddleware, createServerFn, getGlobalStartContext } from "@tanstack/react-start";
14
15
  import { getRequestHeader } from "@tanstack/react-start/server";
@@ -22,7 +23,8 @@ import { jsx } from "react/jsx-runtime";
22
23
  * to read.
23
24
  *
24
25
  * Register it once, as a global request middleware in the app's `src/start.ts`.
25
- * It writes nothing but the session cookie.
26
+ * It writes the session cookie, and in production a header that stops other
27
+ * sites from embedding the app.
26
28
  *
27
29
  * @example
28
30
  * export const startInstance = createStart(() => ({
@@ -31,6 +33,7 @@ import { jsx } from "react/jsx-runtime";
31
33
  */
32
34
  function softrAuthMiddleware() {
33
35
  return createMiddleware({ type: "request" }).middleware([
36
+ embeddingMiddleware(),
34
37
  bootErrorMiddleware(),
35
38
  pwaMiddleware(),
36
39
  faviconMiddleware()
@@ -46,7 +46,7 @@ async function confirmAuthenticatorSetup(details) {
46
46
  throw new Error(`${result.message}. Check SOFTR_APPLICATION_ID and that the app allows an authenticator app.`);
47
47
  }
48
48
  const { session, backupCodes } = result.data;
49
- writeCookies([makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
49
+ writeCookies([...makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
50
50
  user: session.user,
51
51
  permissions: session.permissions
52
52
  }, session.jwt)]);
@@ -75,7 +75,7 @@ async function skipAuthenticatorSetup() {
75
75
  }
76
76
  const { session } = result.data;
77
77
  assert(session, "Expected a session from skipping setup, but got none");
78
- writeCookies([makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
78
+ writeCookies([...makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
79
79
  user: session.user,
80
80
  permissions: session.permissions
81
81
  }, session.jwt)]);
@@ -101,7 +101,7 @@ async function verifyAuthenticator(credentials) {
101
101
  }
102
102
  const { session } = result.data;
103
103
  assert(session, "Expected a session from verification, but got none");
104
- writeCookies([makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
104
+ writeCookies([...makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
105
105
  user: session.user,
106
106
  permissions: session.permissions
107
107
  }, session.jwt)]);
@@ -56,7 +56,7 @@ async function signInWithCode(credentials) {
56
56
  }
57
57
  const { session } = result.data;
58
58
  assert(session, "Expected a session from sign-in, but got none");
59
- writeCookies([makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
59
+ writeCookies([...makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
60
60
  user: session.user,
61
61
  permissions: session.permissions
62
62
  }, session.jwt)]);
@@ -36,7 +36,7 @@ async function signInWithMagicLink(credentials) {
36
36
  }
37
37
  const { session } = result.data;
38
38
  assert(session, "Expected a session from magic-link sign-in, but got none");
39
- writeCookies([makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
39
+ writeCookies([...makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
40
40
  user: session.user,
41
41
  permissions: session.permissions
42
42
  }, session.jwt)]);
@@ -35,7 +35,7 @@ async function signIn(credentials) {
35
35
  }
36
36
  const { session } = result.data;
37
37
  assert(session, "Expected a session from sign-in, but got none");
38
- writeCookies([makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
38
+ writeCookies([...makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
39
39
  user: session.user,
40
40
  permissions: session.permissions
41
41
  }, session.jwt)]);
@@ -68,7 +68,7 @@ async function setPasswordWithLink(details) {
68
68
  }
69
69
  const { session } = result.data;
70
70
  assert(session, "Expected a session from setting a password, but got none");
71
- writeCookies([makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
71
+ writeCookies([...makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
72
72
  user: session.user,
73
73
  permissions: session.permissions
74
74
  }, session.jwt)]);
@@ -66,7 +66,7 @@ async function confirmSignUp(details) {
66
66
  }
67
67
  const { session } = result.data;
68
68
  assert(session, "Expected a session from sign-up, but got none");
69
- writeCookies([makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
69
+ writeCookies([...makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
70
70
  user: session.user,
71
71
  permissions: session.permissions
72
72
  }, session.jwt)]);
@@ -41,7 +41,7 @@ async function signInWithGoogle(credentials) {
41
41
  }
42
42
  const { session } = result.data;
43
43
  assert(session, "Expected a session from Google sign-in, but got none");
44
- writeCookies([makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
44
+ writeCookies([...makeSessionTokenCookie(session.jwt), makeSessionDataCookie({
45
45
  user: session.user,
46
46
  permissions: session.permissions
47
47
  }, session.jwt)]);
@@ -1,8 +1,8 @@
1
1
  import { assert, panic } from "../assertions.js";
2
2
  import { fetch } from "../fetch.js";
3
+ import { softrConfig } from "../softr-config.js";
3
4
  import { permissionsSchema } from "./permissions.js";
4
5
  import { softrApiUrl } from "../softr-api.js";
5
- import { softrConfig } from "../softr-config.js";
6
6
  import { z } from "zod";
7
7
 
8
8
  //#region src/auth/platform.ts
@@ -1,4 +1,4 @@
1
- import { readRequestCookies, serializeCookie, writeCookies } from "../cookies.js";
1
+ import { expireCookie, expireOtherCopy, readRequestCookies, serializeCookie, writeCookies } from "../cookies.js";
2
2
  import { permissionsSchema } from "./permissions.js";
3
3
  import { sessionConfig } from "./config.js";
4
4
  import { userSchema } from "./user.js";
@@ -65,12 +65,16 @@ function readSessionData(sessionToken) {
65
65
  permissions: payload.permissions
66
66
  };
67
67
  }
68
+ /**
69
+ * The token cookie, after a deletion of any copy from before `allowEmbedding`
70
+ * changed. Both would be sent, and the old one could be read instead.
71
+ */
68
72
  function makeSessionTokenCookie(token) {
69
73
  const { name, secure } = sessionCookie(SESSION_TOKEN);
70
- return serializeCookie(name, sealEnvelope(token, SESSION_TOKEN), {
74
+ return [...expireOtherCopy(name, secure), serializeCookie(name, sealEnvelope(token, SESSION_TOKEN), {
71
75
  maxAge: sessionConfig().sessionMaxAge,
72
76
  secure
73
- });
77
+ })];
74
78
  }
75
79
  function makeSessionDataCookie(session, sessionToken) {
76
80
  const { name, secure } = sessionCookie(SESSION_DATA);
@@ -141,10 +145,7 @@ const sessionDataSchema = z.object({
141
145
  */
142
146
  function clearCookies(bases) {
143
147
  const secure = requestIsSecure();
144
- writeCookies(bases.flatMap((base) => secure ? [sessionCookieName(base, secure), base] : [base]).map((name) => serializeCookie(name, "", {
145
- maxAge: 0,
146
- secure
147
- })));
148
+ writeCookies(bases.flatMap((base) => secure ? [sessionCookieName(base, secure), base] : [base]).flatMap((name) => expireCookie(name, secure)));
148
149
  }
149
150
  /**
150
151
  * Over the plaintext token, never the cookie value: that is resealed with a
package/dist/cookies.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { softAssert } from "./assertions.js";
2
+ import { softrConfig } from "./softr-config.js";
2
3
  import { getRequestHeader, getResponseHeaders, setResponseHeader } from "@tanstack/react-start/server";
3
4
 
4
5
  //#region src/cookies.ts
@@ -36,8 +37,33 @@ function serializeCookie(name, value, { maxAge, secure }) {
36
37
  return parts.join("; ");
37
38
  }
38
39
  function sameSiteAttributes(secure) {
39
- if (secure && process.env.NODE_ENV !== "production") return ["SameSite=None", "Partitioned"];
40
- return ["SameSite=Lax"];
40
+ return partitions(secure) ? ["SameSite=None", "Partitioned"] : ["SameSite=Lax"];
41
+ }
42
+ function partitions(secure) {
43
+ return secure && (process.env.NODE_ENV !== "production" || (softrConfig().allowEmbedding ?? []).length > 0);
44
+ }
45
+ function expired(name, partitioned) {
46
+ return partitioned ? `${name}=; Path=/; HttpOnly; Secure; SameSite=None; Partitioned; Max-Age=0` : `${name}=; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=0`;
47
+ }
48
+ /**
49
+ * The deletions for one cookie. A browser keeps a partitioned and a plain
50
+ * cookie of one name apart, and sends both. Which one the app wrote can change
51
+ * between sign-in and sign-out, when `allowEmbedding` changes. So over https,
52
+ * delete both. The one left behind would keep the visitor signed in.
53
+ */
54
+ function expireCookie(name, secure) {
55
+ if (!secure) return [serializeCookie(name, "", {
56
+ maxAge: 0,
57
+ secure
58
+ })];
59
+ return [expired(name, false), expired(name, true)];
60
+ }
61
+ /**
62
+ * The deletion of the copy the other mode would write. Sent with a new cookie,
63
+ * so a copy from before `allowEmbedding` changed can't be read in its place.
64
+ */
65
+ function expireOtherCopy(name, secure) {
66
+ return secure ? [expired(name, !partitions(secure))] : [];
41
67
  }
42
68
  const USER_TIMEZONE_COOKIE = "user-timezone";
43
69
  function readUserTimezone() {
@@ -56,4 +82,4 @@ function writeCookies(cookies) {
56
82
  }
57
83
 
58
84
  //#endregion
59
- export { readRequestCookies, readUserTimezone, serializeCookie, writeCookies };
85
+ export { expireCookie, expireOtherCopy, readRequestCookies, readUserTimezone, serializeCookie, writeCookies };
@@ -0,0 +1,33 @@
1
+ import { softrConfig } from "./softr-config.js";
2
+ import { createMiddleware } from "@tanstack/react-start";
3
+
4
+ //#region src/embedding.ts
5
+ /**
6
+ * Stops other sites from showing the published app in an iframe. The origins
7
+ * softr.json lists in `allowEmbedding` still can.
8
+ *
9
+ * Production only. The dev server runs in the preview pod, and Studio shows
10
+ * that preview in an iframe on another site.
11
+ */
12
+ function embeddingMiddleware() {
13
+ return createMiddleware({ type: "request" }).server(async ({ next }) => {
14
+ const result = await next();
15
+ if (process.env.NODE_ENV !== "production") return result;
16
+ const policy = [
17
+ "frame-ancestors",
18
+ "'self'",
19
+ ...softrConfig().allowEmbedding ?? []
20
+ ].join(" ");
21
+ try {
22
+ result.response.headers.append("content-security-policy", policy);
23
+ return result;
24
+ } catch {
25
+ const response = new Response(result.response.body, result.response);
26
+ response.headers.append("content-security-policy", policy);
27
+ return response;
28
+ }
29
+ });
30
+ }
31
+
32
+ //#endregion
33
+ export { embeddingMiddleware };
package/dist/mcp.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DatasourceAction } from "./action.js";
2
- import * as _tanstack_react_start5 from "@tanstack/react-start";
2
+ import * as _tanstack_react_start6 from "@tanstack/react-start";
3
3
 
4
4
  //#region src/mcp.d.ts
5
5
 
@@ -31,6 +31,6 @@ type SoftrMcpOptions = {
31
31
  * ],
32
32
  * }))
33
33
  */
34
- declare function softrMcpMiddleware(options?: SoftrMcpOptions): _tanstack_react_start5.RequestMiddlewareAfterServer<{}, undefined, undefined>;
34
+ declare function softrMcpMiddleware(options?: SoftrMcpOptions): _tanstack_react_start6.RequestMiddlewareAfterServer<{}, undefined, undefined>;
35
35
  //#endregion
36
36
  export { softrMcpMiddleware };
package/dist/mcp.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { assert } from "./assertions.js";
2
2
  import { fetch } from "./fetch.js";
3
+ import { softrConfig } from "./softr-config.js";
3
4
  import { sessionConfig } from "./auth/config.js";
4
5
  import { readSessionToken, withSessionToken } from "./auth/session.js";
5
6
  import { softrApiUrl } from "./softr-api.js";
6
7
  import { isDatasourceAction } from "./action.js";
7
- import { softrConfig } from "./softr-config.js";
8
8
  import { makePlatform } from "./auth/platform.js";
9
9
  import { ds } from "./datasource/datasource.js";
10
10
  import { z } from "zod";
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.0.87";
2
+ var version = "0.0.88";
3
3
 
4
4
  //#endregion
5
5
  export { version };
@@ -1,6 +1,6 @@
1
1
  import { panic } from "../assertions.js";
2
- import { ACCESS_REASONS, checkRule } from "./visibility.js";
3
2
  import { softrConfig } from "../softr-config.js";
3
+ import { ACCESS_REASONS, checkRule } from "./visibility.js";
4
4
  import { redirect } from "@tanstack/react-router";
5
5
 
6
6
  //#region src/route/route.ts
@@ -21,6 +21,7 @@ const AccessBehaviour = z.union([
21
21
  z.object({ strategy: z.literal("throw") })
22
22
  ], { error: "must be a path like \"/login\", { \"strategy\": \"redirect\", \"to\": \"/login\" } or { \"strategy\": \"throw\" }" });
23
23
  const AppPath = z.string().refine((path$1) => path$1.startsWith("/") && !path$1.includes("?") && !path$1.includes("#") && new URL(path$1, "https://app.invalid").origin === "https://app.invalid", { error: "must be a path on this app like \"/login\", with no \"?\" or \"#\"" });
24
+ const Origin = z.union([z.literal("*"), z.string().regex(/^https:\/\/[^/\\?#@\s;,]+$/).refine(URL.canParse).transform((origin) => new URL(origin).origin)], { error: "must be an https origin like \"https://partner.com\", with no path or trailing \"/\", or \"*\" for any site" });
24
25
  const SoftrConfigSchema = z.object({
25
26
  auth: z.strictObject({
26
27
  routes: z.strictObject({
@@ -47,7 +48,8 @@ const SoftrConfigSchema = z.object({
47
48
  alreadyAuthenticated: AccessBehaviour
48
49
  })
49
50
  }),
50
- user: z.strictObject({ properties: z.record(z.string(), z.string()) }).optional()
51
+ user: z.strictObject({ properties: z.record(z.string(), z.string()) }).optional(),
52
+ allowEmbedding: z.array(Origin).optional()
51
53
  });
52
54
  function loadSoftrConfig(root) {
53
55
  const file = path.join(root, SOFTR_CONFIG_FILE);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softr/sdk",
3
- "version": "0.0.87",
3
+ "version": "0.0.88",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
@@ -67,6 +67,11 @@
67
67
  },
68
68
  "required": ["properties"],
69
69
  "additionalProperties": false
70
+ },
71
+ "allowEmbedding": {
72
+ "type": "array",
73
+ "description": "Sites that may show the published app in an iframe, signed-in pages included, as https origins like \"https://partner.com\", or \"*\" for any site. Any other site is still blocked. With at least one, session cookies use SameSite=None, which drops the browser's CSRF protection. Empty by default.",
74
+ "items": { "type": "string", "pattern": "^(\\*|https://[^/\\\\?#@\\s;,]+)$" }
70
75
  }
71
76
  },
72
77
  "required": ["auth"],
@@ -3,12 +3,13 @@ name: softr-sdk
3
3
  description: >-
4
4
  Entry point for @softr/sdk: its four entrypoints (@softr/sdk, /server,
5
5
  /client, /vite) and their client-server boundary, softrAuthMiddleware and the
6
- Softr context, and which sub-skill covers each task. Load it when unsure which
7
- sub-skill applies, or when touching the wiring.
6
+ Softr context, embedding the app in another site's iframe, and which sub-skill
7
+ covers each task. Load it when unsure which sub-skill applies, when touching
8
+ the wiring, or when the user wants the app embedded elsewhere.
8
9
  metadata:
9
10
  type: core
10
11
  library: softr-sdk
11
- library_version: 0.0.87
12
+ library_version: 0.0.88
12
13
  ---
13
14
 
14
15
  # Softr SDK core
@@ -148,3 +149,7 @@ type User = {
148
149
  userGroupIds: Array<SoftrUserGroupId> // the app's own group ids
149
150
  }
150
151
  ```
152
+
153
+ ## Embedding the app in another site
154
+
155
+ The published app refuses to load inside another site's iframe. The Studio preview is not affected. When the user asks to embed the app on their site, list that site's origin in `softr.json`: `"allowEmbedding": ["https://partner.com"]`. Ask for the exact origin if you don't have it. Only listed sites can embed the app. Use `["*"]` only when the user wants any site to embed it. Remove the list to block embedding again. Sign-in then works inside the embed. Session cookies switch from SameSite=Lax to None, so the app loses the browser's CSRF protection. Only set it when the user asks. There are two more limits to tell the user: Safari may not keep the visitor signed in, and links from emails (magic link, password reset) open the app in a new tab, not in the embed.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.87
12
+ library_version: 0.0.88
13
13
  ---
14
14
 
15
15
  **Boundary.** `auth` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.87
12
+ library_version: 0.0.88
13
13
  ---
14
14
 
15
15
  **Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.87
12
+ library_version: 0.0.88
13
13
  ---
14
14
 
15
15
  # The current user
@@ -7,7 +7,7 @@ description: >-
7
7
  metadata:
8
8
  type: sub-skill
9
9
  library: softr-sdk
10
- library_version: 0.0.87
10
+ library_version: 0.0.88
11
11
  ---
12
12
 
13
13
  **Boundary.** `upload` lives on `@softr/sdk/server` and runs inside server functions. `useFileUpload` and `FileItem` live on `@softr/sdk` and run in components. `FileAttachment` comes from `@softr/sdk` and can be imported anywhere.
@@ -8,7 +8,7 @@ description: >-
8
8
  metadata:
9
9
  type: sub-skill
10
10
  library: softr-sdk
11
- library_version: 0.0.87
11
+ library_version: 0.0.88
12
12
  ---
13
13
 
14
14
  # Dates, times and numbers
@@ -7,7 +7,7 @@ description: >-
7
7
  metadata:
8
8
  type: sub-skill
9
9
  library: softr-sdk
10
- library_version: 0.0.87
10
+ library_version: 0.0.88
11
11
  ---
12
12
 
13
13
  **Boundary.** `integration` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineIntegration` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.87
12
+ library_version: 0.0.88
13
13
  ---
14
14
 
15
15
  **Boundary.** `softrMcpMiddleware` lives on `@softr/sdk` and is registered once, in `src/start.ts`. The actions you hand it are the same `defineQuery` / `defineMutation` values the app's own pages use — declared wherever they already live, not duplicated for MCP.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.87
12
+ library_version: 0.0.88
13
13
  ---
14
14
 
15
15
  # Installing the app
@@ -8,7 +8,7 @@ description: >-
8
8
  metadata:
9
9
  type: sub-skill
10
10
  library: softr-sdk
11
- library_version: 0.0.87
11
+ library_version: 0.0.88
12
12
  ---
13
13
 
14
14
  **Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineMutation` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.87
12
+ library_version: 0.0.88
13
13
  ---
14
14
 
15
15
  **Boundary.** `ds` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler or a server-side route hook — importing it into a component fails the build. The same holds for any helper that calls `ds`: declare it inside the handler. A function at module level that calls `ds` keeps the server-only import in the browser bundle, and every page stops loading until it moves. `defineQuery` and every type come from `@softr/sdk` and can be imported anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.87
12
+ library_version: 0.0.88
13
13
  ---
14
14
 
15
15
  **Boundary.** `Audience` and `defineVisibility` come from `@softr/sdk` and work anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.87
12
+ library_version: 0.0.88
13
13
  ---
14
14
 
15
15
  **Boundary.** `definePage`, `pageHead`, the access functions and the error predicates come from `@softr/sdk` and work anywhere.
@@ -9,7 +9,7 @@ description: >-
9
9
  metadata:
10
10
  type: sub-skill
11
11
  library: softr-sdk
12
- library_version: 0.0.87
12
+ library_version: 0.0.88
13
13
  ---
14
14
 
15
15
  **Boundary.** `workflow` lives on `@softr/sdk/server` and runs only inside a `createServerFn` handler — importing it into a component fails the build. `defineWorkflow` and every type come from `@softr/sdk` and can be imported anywhere.