create-githat-app 1.7.0 → 1.8.1

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 (74) hide show
  1. package/dist/cli.js +4 -3
  2. package/package.json +6 -2
  3. package/templates/agent/app/(auth)/forgot-password/page.tsx.hbs +11 -0
  4. package/templates/agent/app/(auth)/reset-password/page.tsx.hbs +39 -0
  5. package/templates/agent/app/(auth)/verify-email/page.tsx.hbs +41 -0
  6. package/templates/agent/app/admin/agent/page.tsx.hbs +159 -62
  7. package/templates/agent/app/admin/layout.tsx.hbs +82 -0
  8. package/templates/agent/app/admin/mcp/page.tsx.hbs +156 -0
  9. package/templates/agent/app/dashboard/agents/page.tsx.hbs +9 -0
  10. package/templates/agent/app/dashboard/layout.tsx.hbs +9 -0
  11. package/templates/agent/app/dashboard/mcp/page.tsx.hbs +9 -0
  12. package/templates/agent/app/dashboard/page.tsx.hbs +128 -0
  13. package/templates/agent/app/globals.css.hbs +14 -9
  14. package/templates/agent/app/layout.tsx.hbs +7 -2
  15. package/templates/agent/app/page.tsx.hbs +127 -70
  16. package/templates/agent/app/verify/agent/page.tsx.hbs +124 -0
  17. package/templates/agent/next.config.ts.hbs +4 -5
  18. package/templates/agent/public/HERO_IMAGE.md +23 -0
  19. package/templates/base/README.md.hbs +2 -1
  20. package/templates/base/githat/api/agents.ts.hbs +6 -6
  21. package/templates/base/githat/auth/guard.tsx.hbs +6 -6
  22. package/templates/base/githat/config.ts.hbs +7 -9
  23. package/templates/base/githat/dashboard/layout.tsx.hbs +6 -6
  24. package/templates/base/githat/dashboard/overview.tsx.hbs +106 -16
  25. package/templates/classroom/app/layout.tsx.hbs +6 -1
  26. package/templates/classroom/app/projects/[id]/feedback/feedback-content.tsx.hbs +153 -0
  27. package/templates/classroom/app/projects/[id]/feedback/page.tsx.hbs +10 -149
  28. package/templates/classroom/app/projects/[id]/present/page.tsx.hbs +11 -104
  29. package/templates/classroom/app/projects/[id]/present/presenter-content.tsx.hbs +118 -0
  30. package/templates/classroom/next.config.ts.hbs +4 -5
  31. package/templates/content/app/layout.tsx.hbs +6 -1
  32. package/templates/content/app/posts/[slug]/page.tsx.hbs +10 -86
  33. package/templates/content/app/posts/[slug]/post-content.tsx.hbs +93 -0
  34. package/templates/content/next.config.ts.hbs +4 -5
  35. package/templates/dashboard/app/admin/data/[entity]/page.tsx.hbs +15 -2
  36. package/templates/dashboard/app/layout.tsx.hbs +6 -1
  37. package/templates/dashboard/next.config.ts.hbs +4 -5
  38. package/templates/fullstack/apps-web-nextjs/app/layout.tsx.hbs +6 -1
  39. package/templates/fullstack/apps-web-nextjs/next.config.ts.hbs +5 -5
  40. package/templates/marketplace/app/layout.tsx.hbs +6 -1
  41. package/templates/marketplace/next.config.ts.hbs +4 -5
  42. package/templates/nextjs/app/(auth)/forgot-password/page.tsx.hbs +2 -54
  43. package/templates/nextjs/app/(auth)/reset-password/page.tsx.hbs +8 -75
  44. package/templates/nextjs/app/globals.css.hbs +71 -1
  45. package/templates/nextjs/app/layout.tsx.hbs +9 -3
  46. package/templates/nextjs/app/page.tsx.hbs +6 -3
  47. package/templates/nextjs/next.config.ts.hbs +4 -5
  48. package/templates/plain/app/layout.tsx.hbs +6 -1
  49. package/templates/plain/next.config.ts.hbs +4 -5
  50. package/templates/portfolio/app/layout.tsx.hbs +6 -1
  51. package/templates/portfolio/next.config.ts.hbs +4 -5
  52. package/templates/saas/app/layout.tsx.hbs +6 -1
  53. package/templates/saas/next.config.ts.hbs +4 -5
  54. package/templates/agent/app/api/githat/[...path]/route.ts.hbs +0 -21
  55. package/templates/agent/proxy.ts.hbs +0 -10
  56. package/templates/classroom/app/api/githat/[...path]/route.ts.hbs +0 -21
  57. package/templates/classroom/proxy.ts.hbs +0 -10
  58. package/templates/content/app/api/githat/[...path]/route.ts.hbs +0 -21
  59. package/templates/content/proxy.ts.hbs +0 -10
  60. package/templates/dashboard/app/api/githat/[...path]/route.ts.hbs +0 -21
  61. package/templates/dashboard/proxy.ts.hbs +0 -10
  62. package/templates/fullstack/apps-web-nextjs/app/api/githat/[...path]/route.ts.hbs +0 -21
  63. package/templates/marketplace/app/(shop)/[slug]/p/[productId]/page.tsx.hbs +0 -99
  64. package/templates/marketplace/app/(shop)/[slug]/page.tsx.hbs +0 -90
  65. package/templates/marketplace/app/api/githat/[...path]/route.ts.hbs +0 -21
  66. package/templates/marketplace/proxy.ts.hbs +0 -10
  67. package/templates/nextjs/app/api/githat/[...path]/route.ts.hbs +0 -21
  68. package/templates/nextjs/proxy.ts.hbs +0 -10
  69. package/templates/plain/app/api/githat/[...path]/route.ts.hbs +0 -21
  70. package/templates/plain/proxy.ts.hbs +0 -10
  71. package/templates/portfolio/app/api/githat/[...path]/route.ts.hbs +0 -21
  72. package/templates/portfolio/proxy.ts.hbs +0 -10
  73. package/templates/saas/app/api/githat/[...path]/route.ts.hbs +0 -21
  74. package/templates/saas/proxy.ts.hbs +0 -10
@@ -1,62 +1,10 @@
1
1
  {{#if includeForgotPassword}}
2
- 'use client';
3
-
4
- import { useState } from 'react';
5
- {{#if includeGithatFolder}}
6
- import { authApi } from '../../../githat/api/auth{{#unless typescript}}.js{{/unless}}';
7
- {{/if}}
2
+ import { ForgotPasswordForm } from '@githat/nextjs';
8
3
 
9
4
  export default function ForgotPasswordPage() {
10
- const [email, setEmail] = useState('');
11
- const [sent, setSent] = useState(false);
12
- const [error, setError] = useState('');
13
-
14
- const handleSubmit = async (e{{#if typescript}}: React.FormEvent{{/if}}) => {
15
- e.preventDefault();
16
- setError('');
17
- try {
18
- {{#if includeGithatFolder}}
19
- await authApi.forgotPassword(email);
20
- {{else}}
21
- await fetch('{{apiUrl}}/auth/forgot-password', {
22
- method: 'POST',
23
- headers: { 'Content-Type': 'application/json' },
24
- body: JSON.stringify({ email }),
25
- });
26
- {{/if}}
27
- setSent(true);
28
- } catch (err) {
29
- setError('Something went wrong. Please try again.');
30
- }
31
- };
32
-
33
5
  return (
34
6
  <main {{#if useTailwind}}className="flex items-center justify-center min-h-screen bg-[#09090b]"{{else}}style=\{{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '100vh', background: '#09090b' }}{{/if}}>
35
- <div style=\{{ width: '100%', maxWidth: '24rem', padding: '2rem' }}>
36
- <h1 style=\{{ fontSize: '1.5rem', fontWeight: 600, color: '#fafafa', marginBottom: '0.5rem' }}>Reset password</h1>
37
- {sent ? (
38
- <p style=\{{ color: '#a1a1aa' }}>Check your email for a reset link.</p>
39
- ) : (
40
- <form onSubmit={handleSubmit}>
41
- <p style=\{{ color: '#a1a1aa', marginBottom: '1.5rem' }}>Enter your email to receive a reset link.</p>
42
- {error && <p style=\{{ color: '#ef4444', marginBottom: '1rem', fontSize: '0.875rem' }}>{error}</p>}
43
- <input
44
- type="email"
45
- value={email}
46
- onChange={(e) => setEmail(e.target.value)}
47
- placeholder="you@example.com"
48
- required
49
- style=\{{ width: '100%', padding: '0.625rem 0.75rem', background: '#111113', border: '1px solid #1e1e2e', borderRadius: '0.375rem', color: '#fafafa', marginBottom: '1rem', outline: 'none' }}
50
- />
51
- <button
52
- type="submit"
53
- style=\{{ width: '100%', padding: '0.625rem', background: '#7c3aed', color: '#fff', border: 'none', borderRadius: '0.375rem', fontWeight: 600, cursor: 'pointer' }}
54
- >
55
- Send reset link
56
- </button>
57
- </form>
58
- )}
59
- </div>
7
+ <ForgotPasswordForm signInUrl="/sign-in" />
60
8
  </main>
61
9
  );
62
10
  }
@@ -1,56 +1,21 @@
1
1
  {{#if includeForgotPassword}}
2
2
  'use client';
3
3
 
4
- import { Suspense, useState } from 'react';
5
- import { useSearchParams, useRouter } from 'next/navigation';
6
- {{#if includeGithatFolder}}
7
- import { authApi } from '../../../githat/api/auth{{#unless typescript}}.js{{/unless}}';
8
- {{/if}}
4
+ import { Suspense } from 'react';
5
+ import { useSearchParams } from 'next/navigation';
6
+ import { ResetPasswordForm } from '@githat/nextjs';
9
7
 
10
8
  function ResetPasswordContent() {
11
9
  const searchParams = useSearchParams();
12
- const router = useRouter();
13
10
  const token = searchParams.get('token');
14
11
 
15
- const [password, setPassword] = useState('');
16
- const [confirm, setConfirm] = useState('');
17
- const [error, setError] = useState('');
18
- const [loading, setLoading] = useState(false);
19
-
20
- const handleSubmit = async (e{{#if typescript}}: React.FormEvent{{/if}}) => {
21
- e.preventDefault();
22
- if (password !== confirm) {
23
- setError('Passwords do not match');
24
- return;
25
- }
26
- setError('');
27
- setLoading(true);
28
- try {
29
- {{#if includeGithatFolder}}
30
- await authApi.resetPassword(token!, password);
31
- {{else}}
32
- const res = await fetch('{{apiUrl}}/auth/reset-password', {
33
- method: 'POST',
34
- headers: { 'Content-Type': 'application/json' },
35
- body: JSON.stringify({ token, password }),
36
- });
37
- if (!res.ok) throw new Error('Reset failed');
38
- {{/if}}
39
- router.push('/sign-in?reset=success');
40
- } catch (err) {
41
- setError('Failed to reset password. The link may have expired.');
42
- } finally {
43
- setLoading(false);
44
- }
45
- };
46
-
47
12
  if (!token) {
48
13
  return (
49
14
  <main {{#if useTailwind}}className="flex items-center justify-center min-h-screen bg-[#09090b]"{{else}}style=\{{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '100vh', background: '#09090b' }}{{/if}}>
50
- <div style=\{{ textAlign: 'center' }}>
51
- <h1 style=\{{ fontSize: '1.5rem', fontWeight: 600, color: '#fafafa', marginBottom: '0.5rem' }}>Invalid reset link</h1>
52
- <p style=\{{ color: '#a1a1aa' }}>
53
- <a href="/forgot-password" style=\{{ color: '#7c3aed' }}>Request a new one</a>
15
+ <div {{#if useTailwind}}className="text-center"{{else}}style=\{{ textAlign: 'center' }}{{/if}}>
16
+ <h1 {{#if useTailwind}}className="text-xl font-semibold text-white mb-2"{{else}}style=\{{ fontSize: '1.25rem', fontWeight: 600, color: '#fafafa', marginBottom: '0.5rem' }}{{/if}}>Invalid reset link</h1>
17
+ <p {{#if useTailwind}}className="text-zinc-400"{{else}}style=\{{ color: '#a1a1aa' }}{{/if}}>
18
+ <a href="/forgot-password" {{#if useTailwind}}className="text-violet-500 hover:underline"{{else}}style=\{{ color: '#7c3aed' }}{{/if}}>Request a new one</a>
54
19
  </p>
55
20
  </div>
56
21
  </main>
@@ -59,39 +24,7 @@ function ResetPasswordContent() {
59
24
 
60
25
  return (
61
26
  <main {{#if useTailwind}}className="flex items-center justify-center min-h-screen bg-[#09090b]"{{else}}style=\{{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '100vh', background: '#09090b' }}{{/if}}>
62
- <div style=\{{ width: '100%', maxWidth: '24rem', padding: '2rem' }}>
63
- <h1 style=\{{ fontSize: '1.5rem', fontWeight: 600, color: '#fafafa', marginBottom: '0.5rem' }}>Reset password</h1>
64
- <p style=\{{ color: '#a1a1aa', marginBottom: '1.5rem' }}>Enter your new password below.</p>
65
- {error && <p style=\{{ color: '#ef4444', marginBottom: '1rem', fontSize: '0.875rem' }}>{error}</p>}
66
- <form onSubmit={handleSubmit}>
67
- <input
68
- type="password"
69
- value={password}
70
- onChange={(e) => setPassword(e.target.value)}
71
- placeholder="New password"
72
- required
73
- minLength={8}
74
- disabled={loading}
75
- style=\{{ width: '100%', padding: '0.625rem 0.75rem', background: '#111113', border: '1px solid #1e1e2e', borderRadius: '0.375rem', color: '#fafafa', marginBottom: '1rem', outline: 'none' }}
76
- />
77
- <input
78
- type="password"
79
- value={confirm}
80
- onChange={(e) => setConfirm(e.target.value)}
81
- placeholder="Confirm password"
82
- required
83
- disabled={loading}
84
- style=\{{ width: '100%', padding: '0.625rem 0.75rem', background: '#111113', border: '1px solid #1e1e2e', borderRadius: '0.375rem', color: '#fafafa', marginBottom: '1rem', outline: 'none' }}
85
- />
86
- <button
87
- type="submit"
88
- disabled={loading}
89
- style=\{{ width: '100%', padding: '0.625rem', background: '#7c3aed', color: '#fff', border: 'none', borderRadius: '0.375rem', fontWeight: 600, cursor: loading ? 'not-allowed' : 'pointer', opacity: loading ? 0.7 : 1 }}
90
- >
91
- {loading ? 'Resetting...' : 'Reset password'}
92
- </button>
93
- </form>
94
- </div>
27
+ <ResetPasswordForm token={token} signInUrl="/sign-in" />
95
28
  </main>
96
29
  );
97
30
  }
@@ -1,8 +1,77 @@
1
- @import "@githat/ui/tokens.css";
1
+ /*
2
+ * Tailwind v4 — required because @githat/nextjs/styles is processed
3
+ * through @tailwindcss/postcss. Import the utilities if you want them;
4
+ * the auth pages only need the CSS variables below.
5
+ */
2
6
  {{#if useTailwind}}
3
7
  @import "tailwindcss";
4
8
  {{/if}}
5
9
 
10
+ /*
11
+ * Self-contained design tokens.
12
+ *
13
+ * Defines the CSS variables used by @githat/nextjs/styles and all
14
+ * template components. Override these to re-skin the whole app.
15
+ */
16
+
17
+ :root {
18
+ /* Surface */
19
+ --bg: #ffffff;
20
+ --surface: #fafafa;
21
+ --surface-sub: #f4f4f5;
22
+
23
+ /* Borders */
24
+ --border: #e5e7eb;
25
+
26
+ /* Foreground */
27
+ --fg: #0a0a0a;
28
+ --fg-muted: #525252;
29
+ --fg-subtle: #737373;
30
+
31
+ /* Brand — change these two to re-skin the whole auth flow */
32
+ --primary: #6366f1;
33
+ --accent: #f59e0b;
34
+
35
+ /* Semantic */
36
+ --success: #16a34a;
37
+ --warn: #d97706;
38
+ --danger: #dc2626;
39
+ --info: #0ea5e9;
40
+
41
+ /* Spacing — used by @githat/nextjs/styles */
42
+ --space-1: 0.25rem;
43
+ --space-2: 0.5rem;
44
+ --space-3: 0.75rem;
45
+ --space-4: 1rem;
46
+ --space-5: 1.25rem;
47
+ --space-6: 1.5rem;
48
+ --space-8: 2rem;
49
+ --space-12: 3rem;
50
+
51
+ /* Radius */
52
+ --radius: 0.5rem;
53
+ --radius-md: 0.5rem;
54
+ --radius-lg: 0.75rem;
55
+ --radius-full: 9999px;
56
+
57
+ /* Fonts */
58
+ --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
59
+ --font-wordmark: 'Instrument Serif', Georgia, serif;
60
+ --font-mono: 'Fira Code', 'Cascadia Code', Consolas, monospace;
61
+ }
62
+
63
+ @media (prefers-color-scheme: dark) {
64
+ :root {
65
+ --bg: #09090b;
66
+ --surface: #111113;
67
+ --surface-sub: #1e1e2e;
68
+ --border: #27272a;
69
+ --fg: #fafafa;
70
+ --fg-muted: #a1a1aa;
71
+ --fg-subtle: #71717a;
72
+ }
73
+ }
74
+
6
75
  * {
7
76
  box-sizing: border-box;
8
77
  margin: 0;
@@ -13,6 +82,7 @@ body {
13
82
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
14
83
  background: var(--bg, #09090b);
15
84
  color: var(--fg, #fafafa);
85
+ line-height: 1.5;
16
86
  }
17
87
 
18
88
  a {
@@ -1,5 +1,4 @@
1
1
  import { GitHatProvider } from '@githat/nextjs';
2
- import { Wordmark } from '@githat/ui';
3
2
  import '@githat/nextjs/styles';
4
3
  import './globals.css';
5
4
  {{#if includeGithatFolder}}
@@ -20,7 +19,12 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
20
19
  ...githatConfig,
21
20
  {{else}}
22
21
  publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
23
- apiUrl: '/api/githat',
22
+ apiUrl: 'https://api.githat.io',
23
+ {{#if typescript}}
24
+ tokenStorage: 'localStorage' as const,
25
+ {{else}}
26
+ tokenStorage: 'localStorage',
27
+ {{/if}}
24
28
  signInUrl: '/sign-in',
25
29
  signUpUrl: '/sign-up',
26
30
  afterSignInUrl: '/dashboard',
@@ -28,7 +32,9 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
28
32
  {{/if}}
29
33
  }}>
30
34
  <header style=\{{ padding: 'var(--space-4, 1rem) var(--space-6, 1.5rem)', borderBottom: '1px solid var(--border, #e5e7eb)' }}>
31
- <Wordmark name="{{businessName}}" size="md" href="/" />
35
+ <a href="/" style=\{{ textDecoration: 'none', color: 'inherit', fontWeight: 700, fontSize: '1.125rem' }}>
36
+ {{businessName}}
37
+ </a>
32
38
  </header>
33
39
  <main>{children}</main>
34
40
  </GitHatProvider>
@@ -1,5 +1,4 @@
1
1
  import { SignInButton, SignUpButton } from '@githat/nextjs';
2
- import { Wordmark } from '@githat/ui';
3
2
 
4
3
  const hasKey = !!process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY;
5
4
 
@@ -7,7 +6,9 @@ function SetupGuide() {
7
6
  return (
8
7
  <main {{#if useTailwind}}className="flex flex-col items-center justify-center min-h-screen gap-8 bg-[#09090b] text-[#fafafa] px-6"{{else}}style=\{{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', minHeight: '100vh', gap: '2rem', background: '#09090b', color: '#fafafa', padding: '0 1.5rem' }}{{/if}}>
9
8
  <div {{#if useTailwind}}className="text-center"{{else}}style=\{{ textAlign: 'center' }}{{/if}}>
10
- <Wordmark name="{{businessName}}" size="xl" />
9
+ <h1 {{#if useTailwind}}className="text-2xl font-bold"{{else}}style=\{{ fontSize: '1.5rem', fontWeight: 700 }}{{/if}}>
10
+ {{businessName}}
11
+ </h1>
11
12
  <p {{#if useTailwind}}className="text-zinc-400"{{else}}style=\{{ color: '#a1a1aa' }}{{/if}}>
12
13
  Get started in 3 steps
13
14
  </p>
@@ -57,7 +58,9 @@ export default function Home() {
57
58
 
58
59
  return (
59
60
  <main {{#if useTailwind}}className="flex flex-col items-center justify-center min-h-screen gap-6 bg-[#09090b] text-[#fafafa]"{{else}}style=\{{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', minHeight: '100vh', gap: '1.5rem', background: '#09090b', color: '#fafafa' }}{{/if}}>
60
- <Wordmark name="{{businessName}}" size="xl" />
61
+ <h1 {{#if useTailwind}}className="text-2xl font-bold"{{else}}style=\{{ fontSize: '1.5rem', fontWeight: 700 }}{{/if}}>
62
+ {{businessName}}
63
+ </h1>
61
64
  <p {{#if useTailwind}}className="text-zinc-400 max-w-lg text-center"{{else}}style=\{{ color: '#a1a1aa', maxWidth: '32rem', textAlign: 'center' }}{{/if}}>
62
65
  {{description}}
63
66
  </p>
@@ -1,9 +1,8 @@
1
- {{#if typescript}}import type { NextConfig } from 'next';
2
- {{/if}}import { withGitHat } from '@githat/nextjs/server';
1
+ import { withGitHat } from '@githat/nextjs/server';
3
2
 
4
- {{#if typescript}}const nextConfig: NextConfig = {
5
- {{else}}const nextConfig = {
6
- {{/if}} output: 'standalone',
3
+ const nextConfig = {
4
+ output: 'export',
5
+ images: { unoptimized: true },
7
6
  };
8
7
 
9
8
  export default withGitHat(nextConfig);
@@ -19,7 +19,12 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
19
19
  */}
20
20
  <GitHatProvider config=\{{
21
21
  publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
22
- apiUrl: '/api/githat',
22
+ apiUrl: 'https://api.githat.io',
23
+ {{#if typescript}}
24
+ tokenStorage: 'localStorage' as const,
25
+ {{else}}
26
+ tokenStorage: 'localStorage',
27
+ {{/if}}
23
28
  signInUrl: '/sign-in',
24
29
  signUpUrl: '/sign-up',
25
30
  afterSignInUrl: '/',
@@ -1,9 +1,8 @@
1
- {{#if typescript}}import type { NextConfig } from 'next';
2
- {{/if}}import { withGitHat } from '@githat/nextjs/server';
1
+ import { withGitHat } from '@githat/nextjs/server';
3
2
 
4
- {{#if typescript}}const nextConfig: NextConfig = {
5
- {{else}}const nextConfig = {
6
- {{/if}} output: 'standalone',
3
+ const nextConfig = {
4
+ output: 'export',
5
+ images: { unoptimized: true },
7
6
  };
8
7
 
9
8
  export default withGitHat(nextConfig);
@@ -19,7 +19,12 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
19
19
  */}
20
20
  <GitHatProvider config=\{{
21
21
  publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
22
- apiUrl: '/api/githat',
22
+ apiUrl: 'https://api.githat.io',
23
+ {{#if typescript}}
24
+ tokenStorage: 'localStorage' as const,
25
+ {{else}}
26
+ tokenStorage: 'localStorage',
27
+ {{/if}}
23
28
  signInUrl: '/sign-in',
24
29
  signUpUrl: '/sign-up',
25
30
  afterSignInUrl: '/',
@@ -1,9 +1,8 @@
1
- {{#if typescript}}import type { NextConfig } from 'next';
2
- {{/if}}import { withGitHat } from '@githat/nextjs/server';
1
+ import { withGitHat } from '@githat/nextjs/server';
3
2
 
4
- {{#if typescript}}const nextConfig: NextConfig = {
5
- {{else}}const nextConfig = {
6
- {{/if}} output: 'standalone',
3
+ const nextConfig = {
4
+ output: 'export',
5
+ images: { unoptimized: true },
7
6
  };
8
7
 
9
8
  export default withGitHat(nextConfig);
@@ -19,7 +19,12 @@ export default function RootLayout({ children }{{#if typescript}}: { children: R
19
19
  */}
20
20
  <GitHatProvider config=\{{
21
21
  publishableKey: process.env.NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY || '',
22
- apiUrl: '/api/githat',
22
+ apiUrl: 'https://api.githat.io',
23
+ {{#if typescript}}
24
+ tokenStorage: 'localStorage' as const,
25
+ {{else}}
26
+ tokenStorage: 'localStorage',
27
+ {{/if}}
23
28
  signInUrl: '/sign-in',
24
29
  signUpUrl: '/sign-up',
25
30
  afterSignInUrl: '/',
@@ -1,9 +1,8 @@
1
- {{#if typescript}}import type { NextConfig } from 'next';
2
- {{/if}}import { withGitHat } from '@githat/nextjs/server';
1
+ import { withGitHat } from '@githat/nextjs/server';
3
2
 
4
- {{#if typescript}}const nextConfig: NextConfig = {
5
- {{else}}const nextConfig = {
6
- {{/if}} output: 'standalone',
3
+ const nextConfig = {
4
+ output: 'export',
5
+ images: { unoptimized: true },
7
6
  };
8
7
 
9
8
  export default withGitHat(nextConfig);
@@ -1,21 +0,0 @@
1
- /**
2
- * Same-origin GitHat API proxy.
3
- *
4
- * Forwards every request to api.githat.io and re-emits upstream Set-Cookie
5
- * headers on this app's domain. Without this bridge, the auth cookie set
6
- * by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
7
- * which produces a sign-in → app-page → "session expired" loop.
8
- *
9
- * The SDK is wired to this URL via `apiUrl: "/api/githat"` on
10
- * GitHatProvider, so every fetch becomes same-origin and cookies land
11
- * on this app's domain.
12
- *
13
- * Implementation lives in @githat/nextjs/server.githatApiProxy().
14
- */
15
- import { githatApiProxy } from "@githat/nextjs/server";
16
-
17
- export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
18
-
19
- // Auth flows are stateful — never cache the proxied responses.
20
- export const dynamic = "force-dynamic";
21
- export const revalidate = 0;
@@ -1,10 +0,0 @@
1
- import { authProxy } from '@githat/nextjs/proxy';
2
-
3
- export const proxy = authProxy({
4
- publicRoutes: ['/', '/sign-in', '/sign-up'{{#if includeForgotPassword}}, '/forgot-password', '/reset-password'{{/if}}{{#if includeEmailVerification}}, '/verify-email'{{/if}}],
5
- signInUrl: '/sign-in',
6
- });
7
-
8
- export const config = {
9
- matcher: ['/((?!_next|api|.*\\..*).*)'],
10
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * Same-origin GitHat API proxy.
3
- *
4
- * Forwards every request to api.githat.io and re-emits upstream Set-Cookie
5
- * headers on this app's domain. Without this bridge, the auth cookie set
6
- * by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
7
- * which produces a sign-in → app-page → "session expired" loop.
8
- *
9
- * The SDK is wired to this URL via `apiUrl: "/api/githat"` on
10
- * GitHatProvider, so every fetch becomes same-origin and cookies land
11
- * on this app's domain.
12
- *
13
- * Implementation lives in @githat/nextjs/server.githatApiProxy().
14
- */
15
- import { githatApiProxy } from "@githat/nextjs/server";
16
-
17
- export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
18
-
19
- // Auth flows are stateful — never cache the proxied responses.
20
- export const dynamic = "force-dynamic";
21
- export const revalidate = 0;
@@ -1,10 +0,0 @@
1
- import { authProxy } from '@githat/nextjs/proxy';
2
-
3
- export const proxy = authProxy({
4
- publicRoutes: ['/', '/sign-in', '/sign-up'{{#if includeForgotPassword}}, '/forgot-password', '/reset-password'{{/if}}{{#if includeEmailVerification}}, '/verify-email'{{/if}}],
5
- signInUrl: '/sign-in',
6
- });
7
-
8
- export const config = {
9
- matcher: ['/((?!_next|api|.*\\..*).*)'],
10
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * Same-origin GitHat API proxy.
3
- *
4
- * Forwards every request to api.githat.io and re-emits upstream Set-Cookie
5
- * headers on this app's domain. Without this bridge, the auth cookie set
6
- * by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
7
- * which produces a sign-in → app-page → "session expired" loop.
8
- *
9
- * The SDK is wired to this URL via `apiUrl: "/api/githat"` on
10
- * GitHatProvider, so every fetch becomes same-origin and cookies land
11
- * on this app's domain.
12
- *
13
- * Implementation lives in @githat/nextjs/server.githatApiProxy().
14
- */
15
- import { githatApiProxy } from "@githat/nextjs/server";
16
-
17
- export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
18
-
19
- // Auth flows are stateful — never cache the proxied responses.
20
- export const dynamic = "force-dynamic";
21
- export const revalidate = 0;
@@ -1,10 +0,0 @@
1
- import { authProxy } from '@githat/nextjs/proxy';
2
-
3
- export const proxy = authProxy({
4
- publicRoutes: ['/', '/sign-in', '/sign-up'{{#if includeForgotPassword}}, '/forgot-password', '/reset-password'{{/if}}{{#if includeEmailVerification}}, '/verify-email'{{/if}}],
5
- signInUrl: '/sign-in',
6
- });
7
-
8
- export const config = {
9
- matcher: ['/((?!_next|api|.*\\..*).*)'],
10
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * Same-origin GitHat API proxy.
3
- *
4
- * Forwards every request to api.githat.io and re-emits upstream Set-Cookie
5
- * headers on this app's domain. Without this bridge, the auth cookie set
6
- * by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
7
- * which produces a sign-in → app-page → "session expired" loop.
8
- *
9
- * The SDK is wired to this URL via `apiUrl: "/api/githat"` on
10
- * GitHatProvider, so every fetch becomes same-origin and cookies land
11
- * on this app's domain.
12
- *
13
- * Implementation lives in @githat/nextjs/server.githatApiProxy().
14
- */
15
- import { githatApiProxy } from "@githat/nextjs/server";
16
-
17
- export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
18
-
19
- // Auth flows are stateful — never cache the proxied responses.
20
- export const dynamic = "force-dynamic";
21
- export const revalidate = 0;
@@ -1,10 +0,0 @@
1
- import { authProxy } from '@githat/nextjs/proxy';
2
-
3
- export const proxy = authProxy({
4
- publicRoutes: ['/', '/sign-in', '/sign-up'{{#if includeForgotPassword}}, '/forgot-password', '/reset-password'{{/if}}{{#if includeEmailVerification}}, '/verify-email'{{/if}}],
5
- signInUrl: '/sign-in',
6
- });
7
-
8
- export const config = {
9
- matcher: ['/((?!_next|api|.*\\..*).*)'],
10
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * Same-origin GitHat API proxy.
3
- *
4
- * Forwards every request to api.githat.io and re-emits upstream Set-Cookie
5
- * headers on this app's domain. Without this bridge, the auth cookie set
6
- * by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
7
- * which produces a sign-in → app-page → "session expired" loop.
8
- *
9
- * The SDK is wired to this URL via `apiUrl: "/api/githat"` on
10
- * GitHatProvider, so every fetch becomes same-origin and cookies land
11
- * on this app's domain.
12
- *
13
- * Implementation lives in @githat/nextjs/server.githatApiProxy().
14
- */
15
- import { githatApiProxy } from "@githat/nextjs/server";
16
-
17
- export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
18
-
19
- // Auth flows are stateful — never cache the proxied responses.
20
- export const dynamic = "force-dynamic";
21
- export const revalidate = 0;