create-githat-app 1.8.9 → 1.8.11

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/dist/cli.js CHANGED
@@ -21,7 +21,7 @@ var DEPS = {
21
21
  next: "^16.0.0",
22
22
  react: "^19.0.0",
23
23
  "react-dom": "^19.0.0",
24
- "@githat/nextjs": "^0.13.6",
24
+ "@githat/nextjs": "^0.13.8",
25
25
  "@githat/ui": "^1.0.0"
26
26
  },
27
27
  devDependencies: {
@@ -36,7 +36,7 @@ var DEPS = {
36
36
  react: "^19.0.0",
37
37
  "react-dom": "^19.0.0",
38
38
  "react-router-dom": "^7.0.0",
39
- "@githat/nextjs": "^0.13.6",
39
+ "@githat/nextjs": "^0.13.8",
40
40
  "@githat/ui": "^1.0.0"
41
41
  },
42
42
  devDependencies: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-githat-app",
3
- "version": "1.8.9",
3
+ "version": "1.8.11",
4
4
  "description": "GitHat CLI — scaffold apps and manage the skills marketplace",
5
5
  "type": "module",
6
6
  "bin": {
@@ -239,6 +239,128 @@ Resource-level wildcards are supported: `audit.*` receives every audit event
239
239
  for every user in your app. The connection auto-reconnects with exponential
240
240
  back-off (1 s → 2 s → 4 s → 8 s → 30 s cap).
241
241
 
242
+ ## Row-Level Security
243
+
244
+ GitHat RLS lets you define per-collection policies that gate which rows each user
245
+ can read or write — without writing any backend code. Policies are evaluated on
246
+ every `useData()` call and stored in the GitHat dashboard.
247
+
248
+ ### Quick example
249
+
250
+ ```tsx
251
+ import { useRLS } from '@githat/nextjs';
252
+
253
+ const { setPolicy, testPolicy } = useRLS();
254
+
255
+ // Ensure users can only read/write their own rows in "documents"
256
+ await setPolicy('documents', {
257
+ readPolicy: { type: 'fieldEquals', field: 'userId', context: 'callerUserId' },
258
+ writePolicy: { type: 'fieldEquals', field: 'userId', context: 'callerUserId' },
259
+ });
260
+
261
+ // Dry-run before shipping
262
+ const { allowed, reasons } = await testPolicy({
263
+ collection: 'documents',
264
+ row: { userId: 'user-abc', title: 'My doc' },
265
+ operation: 'read',
266
+ context: { userId: 'user-abc' },
267
+ });
268
+ // → { allowed: true, reasons: ['policy satisfied'] }
269
+ ```
270
+
271
+ ### Predicate types
272
+
273
+ | Type | Description |
274
+ |------|-------------|
275
+ | `public` | Matches everything — no restriction |
276
+ | `fieldEquals` | `row[field]` must equal `callerUserId` or `callerOrgId` |
277
+ | `fieldIn` | `row[field]` must be in caller's org list |
278
+ | `orgRoleAtLeast` | Caller must hold `owner`, `admin`, or `member` in the row's org |
279
+ | `and` / `or` / `not` | Compose any of the above |
280
+
281
+ Manage policies visually at **Dashboard → Row-Level Security** or via `useRLS()`.
282
+ If no policy is set, all authenticated users have access (backwards-compatible default).
283
+
284
+ ## Custom domains
285
+
286
+ GitHat can host your app on a custom domain you already own (Bring Your Own Domain)
287
+ or register a brand-new one for you through Route 53 Domains.
288
+
289
+ ### Bring Your Own Domain (BYOD)
290
+
291
+ 1. Go to **Dashboard → Domains** (or your app's **Domains** tab) and enter your domain.
292
+ 2. GitHat detects your DNS provider (Route 53, Cloudflare, GoDaddy, Namecheap, or generic)
293
+ and returns the CNAME and TXT records you need to add.
294
+ 3. If your domain is already in a Route 53 hosted zone GitHat manages, the records are
295
+ written automatically — no manual DNS steps needed.
296
+ 4. GitHat polls every 5 minutes and advances through the onboarding stages automatically:
297
+
298
+ `pending_dns` → `dns_verified` → `cert_pending` → `cert_issued` → `cf_attaching` → `live`
299
+
300
+ You can embed the full wizard in your own UI using the SDK component:
301
+
302
+ ```tsx
303
+ import { DomainOnboardingWizard } from '@githat/nextjs';
304
+
305
+ <DomainOnboardingWizard
306
+ appId={appId}
307
+ onLive={(domain) => console.log(`${domain} is live!`)}
308
+ />
309
+ ```
310
+
311
+ Or drive it programmatically with the hook:
312
+
313
+ ```ts
314
+ import { useDomains } from '@githat/nextjs';
315
+
316
+ const { addDomain, getStatus, checkDomain, removeDomain } = useDomains();
317
+
318
+ // Start onboarding
319
+ const result = await addDomain(appId, 'mystore.com');
320
+ // result.dnsRecords — show these to the user
321
+ // result.instructions.autoWrite — true if GitHat wrote DNS automatically
322
+
323
+ // Poll status
324
+ const status = await getStatus(appId, 'mystore.com');
325
+ // status.status — one of the stages above
326
+
327
+ // Trigger a manual DNS + cert poll cycle
328
+ await checkDomain(appId, 'mystore.com');
329
+ ```
330
+
331
+ ### Register a new domain
332
+
333
+ Check availability across multiple TLDs and register right from GitHat:
334
+
335
+ ```ts
336
+ import { useDomains } from '@githat/nextjs';
337
+
338
+ const { checkAvailability, registerDomain, getRegistration } = useDomains();
339
+
340
+ // Check availability + pricing
341
+ const { domains } = await checkAvailability('mystore', ['com', 'io', 'co']);
342
+ // domains[0] → { domain, available, awsPriceUsd, platformFeeUsd, totalUsd }
343
+
344
+ // Register (auto-starts BYOD onboarding after the domain propagates)
345
+ const { operationId } = await registerDomain({
346
+ domain: 'mystore.com',
347
+ autoRenew: true,
348
+ contactInfo: {
349
+ firstName: 'Jane', lastName: 'Doe',
350
+ email: 'jane@example.com', phoneNumber: '+1.5555550100',
351
+ address: '123 Main St', city: 'Seattle',
352
+ state: 'WA', countryCode: 'US', zipCode: '98101',
353
+ },
354
+ });
355
+
356
+ // Poll registration status
357
+ const reg = await getRegistration(operationId);
358
+ // reg.status — 'SUBMITTED' | 'IN_PROGRESS' | 'SUCCESSFUL' | 'FAILED'
359
+ ```
360
+
361
+ Registration is handled through AWS Route 53 Domains (backed by ICANN-accredited
362
+ registrars). WHOIS privacy protection is enabled by default.
363
+
242
364
  ## Learn More
243
365
 
244
366
  - [GitHat Documentation](https://githat.io/docs)