create-user-hub 0.4.2 → 0.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-user-hub",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Start a TanStack Start + Convex app with User Hub sign-in: bun create user-hub@latest my-app",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,6 +9,7 @@ A TanStack Start + Convex app whose sign-in comes from User Hub: people scan the
9
9
  - `convex/auth.config.ts`: `hubAuth({ app: APP_KEY })`; Convex trusts hub tokens through `HUB_ISSUER` and `HUB_JWKS` on the deployment.
10
10
  - `src/routes/__root.tsx`: `ConvexHubAuthProvider` and `HubSignedIn` inside `<body>`. Never move them outside `<html>` or into the router's `Wrap`. Its `beforeLoad` reads the person's token on the server (`getHubToken`) and passes it as `initialToken`, so pages render signed in from the server: keep page components safe to render there (no `window` or `document` outside effects).
11
11
  - People: `useHubUser()` in components; `requireHubUser(ctx)` / `requireFacilitator(ctx)` in Convex functions. Key data on the person's hub id; check roles on the server.
12
+ - Server functions and server routes that act as the person (calling another service, saving to Convex): `hubConvexMiddleware` from `@user-hub/auth/start-convex`, created once, with `hub.serverFn` on server functions and `hub.request` on server routes (the skill's `references/server-functions.md`). Never read the `Authorization` header, call `verifyHubToken` or build a `ConvexHttpClient` for the person yourself.
12
13
  - Sign out: `useHubSignOut()`.
13
14
 
14
15
  ## Rules
@@ -19,7 +19,7 @@
19
19
  "@tailwindcss/vite": "^4.3.5",
20
20
  "@tanstack/react-router": "^1.170.46",
21
21
  "@tanstack/react-start": "^1.169.7",
22
- "@user-hub/auth": "^0.6.0",
22
+ "@user-hub/auth": "^0.7.0",
23
23
  "class-variance-authority": "^0.7.1",
24
24
  "cn": "^0.5.2",
25
25
  "convex": "^1.51.0",