lakebed 0.0.3-alpha.0 → 0.0.4

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 CHANGED
@@ -55,6 +55,37 @@ export default capsule({
55
55
  });
56
56
  ```
57
57
 
58
+ ## Auth
59
+
60
+ Every app starts with local guest auth. To let users sign in with Google, render the built-in button. Lakebed always asks Shoo for profile fields so the app can show a useful identifier like `auth.email` or `auth.displayName`.
61
+
62
+ ```tsx
63
+ import { SignInWithGoogle, signOut, useAuth } from "lakebed/client";
64
+
65
+ export function App() {
66
+ const auth = useAuth();
67
+ const authLabel = auth.email ?? auth.displayName;
68
+
69
+ return auth.isGuest ? (
70
+ <SignInWithGoogle />
71
+ ) : (
72
+ <button type="button" onClick={() => signOut()}>
73
+ Sign out {authLabel}
74
+ </button>
75
+ );
76
+ }
77
+ ```
78
+
79
+ After sign-in, server handlers receive the verified Google identity through `ctx.auth`:
80
+
81
+ ```ts
82
+ mutations: {
83
+ save: mutation((ctx) => {
84
+ ctx.log.info("signed in user", { userId: ctx.auth.userId, email: ctx.auth.email });
85
+ });
86
+ }
87
+ ```
88
+
58
89
  ## Commands
59
90
 
60
91
  ```sh
@@ -62,7 +93,8 @@ lakebed new <name> [--template todo]
62
93
  lakebed dev <capsule-dir> [--port 3000]
63
94
  lakebed build <capsule-dir> --target anonymous [--out .lakebed/artifacts/app.json] [--json]
64
95
  lakebed deploy [capsule-dir] [--ttl 7d] [--api <url>] [--json]
65
- lakebed anonymous-server [--port 8787] [--public-root-url <url>]
96
+ lakebed claim [capsule-dir] [--api <url>] [--json]
97
+ lakebed anonymous-server [--port 8787] [--public-root-url <url>] [--app-base-domain <domain>]
66
98
  lakebed inspect <deploy-id-or-url> [--api <url>] [--json]
67
99
  lakebed db list [deploy-id-or-url] [--port 3000]
68
100
  lakebed db dump [deploy-id-or-url] [--port 3000]
@@ -75,7 +107,7 @@ lakebed logs [deploy-id-or-url] [--port 3000]
75
107
  - Arbitrary npm imports inside capsules are not supported yet.
76
108
  - Node built-ins are not available inside capsule modules.
77
109
  - Tailwind classes in JSX are the only styling path in v0.
78
- - Guest auth is the only auth mode.
110
+ - Guest auth works by default. Google sign-in is built in through Shoo and exposes verified identity on `ctx.auth`.
79
111
  - Anonymous deploys disable outbound `fetch`.
80
112
 
81
113
  ## Hosted Deploys
@@ -94,3 +126,26 @@ lakebed anonymous-server --port 8787
94
126
  cd my-app
95
127
  lakebed deploy --api http://localhost:8787
96
128
  ```
129
+
130
+ In production, set `PUBLIC_ROOT_URL` to the deploy API origin and `LAKEBED_APP_BASE_DOMAIN` to the app domain without the wildcard prefix:
131
+
132
+ ```sh
133
+ PUBLIC_ROOT_URL=https://api.lakebed.app
134
+ LAKEBED_APP_BASE_DOMAIN=lakebed.app
135
+ ```
136
+
137
+ With a verified `*.lakebed.app` custom domain on the runner, deploy responses use `https://<slug>.lakebed.app`.
138
+
139
+ Deploy responses include a claim URL. Configure GitHub OAuth on the runner, then open that claim URL to attach the anonymous deploy to a developer account:
140
+
141
+ ```sh
142
+ LAKEBED_GITHUB_CLIENT_ID=...
143
+ LAKEBED_GITHUB_CLIENT_SECRET=...
144
+ LAKEBED_SESSION_SECRET=...
145
+ ```
146
+
147
+ Claimed deploys are listed at `/deploys` on the deploy API origin. They keep the same resource limits as anonymous deploys. Anonymous deploys cannot use outbound `fetch`; after a deploy is claimed, `lakebed deploy` can update it with a source-backed server artifact that supports async handlers and server-side fetch.
148
+
149
+ ## Admin Dashboard
150
+
151
+ Set `LAKEBED_ADMIN_PASSWORD` on the anonymous deploy runner, then open `/admin` on the runner origin. The password is exchanged for an HttpOnly cookie so the dashboard stays unlocked until the cookie expires or the password changes. The resource table can terminate active deploys while preserving their resource history.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lakebed",
3
- "version": "0.0.3-alpha.0",
3
+ "version": "0.0.4",
4
4
  "description": "Agent-native CLI and runtime for building and deploying Lakebed capsules.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -22,6 +22,7 @@
22
22
  "files": [
23
23
  "src/anonymous-server.js",
24
24
  "src/anonymous.js",
25
+ "src/auth.js",
25
26
  "src/cli.js",
26
27
  "src/client.d.ts",
27
28
  "src/client.js",
@@ -47,9 +48,6 @@
47
48
  "publishConfig": {
48
49
  "access": "public"
49
50
  },
50
- "scripts": {
51
- "check": "node --check src/cli.js && node --check src/runtime.js && node --check src/server.js && node --check src/client.js && node --check src/source-store.js && node --check src/anonymous.js && node --check src/anonymous-server.js"
52
- },
53
51
  "dependencies": {
54
52
  "esbuild": "^0.27.1",
55
53
  "pg": "^8.16.3",
@@ -58,5 +56,8 @@
58
56
  },
59
57
  "devDependencies": {
60
58
  "@types/ws": "^8.18.1"
59
+ },
60
+ "scripts": {
61
+ "check": "node --check src/cli.js && node --check src/runtime.js && node --check src/server.js && node --check src/client.js && node --check src/source-store.js && node --check src/anonymous.js && node --check src/anonymous-server.js && node --check src/auth.js"
61
62
  }
62
- }
63
+ }