@vibiz/cli 0.2.2 → 0.2.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/dist/{chunk-OKWUSSLA.js → chunk-5SMCAX6T.js} +269 -4
- package/dist/src-HBX5XNYH.js +4066 -0
- package/dist/vibiz.js +745 -125
- package/package.json +1 -1
- package/templates/nextjs-saas/.env.example +0 -2
- package/templates/nextjs-saas/README.md +10 -11
- package/templates/nextjs-saas/app/dashboard/page.tsx +0 -2
- package/templates/nextjs-saas/app/layout.tsx +0 -2
- package/templates/nextjs-saas/app/page.tsx +2 -6
- package/dist/src-BY7YFVXW.js +0 -3423
- package/templates/nextjs-saas/components/replay-consent.tsx +0 -75
- package/templates/nextjs-saas/components/replay-identify.tsx +0 -21
- package/templates/nextjs-saas/lib/replay.ts +0 -55
package/package.json
CHANGED
|
@@ -6,8 +6,6 @@ VIBIZ_AUTH_COOKIE_SECRET=
|
|
|
6
6
|
# Optional: site analytics. When both are set, the analytics script loads.
|
|
7
7
|
NEXT_PUBLIC_VIBIZ_ANALYTICS_KEY=
|
|
8
8
|
NEXT_PUBLIC_VIBIZ_ANALYTICS_URL=
|
|
9
|
-
# Optional: session replay (the `replay` resource). Asks visitors for consent first.
|
|
10
|
-
NEXT_PUBLIC_VIBIZ_REPLAY=
|
|
11
9
|
# Optional: the AI assistant on the dashboard (`vibiz add ai`). OPENAI_* are aliases.
|
|
12
10
|
VIBIZ_AI_BASE_URL=
|
|
13
11
|
VIBIZ_AI_API_KEY=
|
|
@@ -66,9 +66,7 @@ app/api/auth/[...path] forwards sign-in requests to the sign-in service
|
|
|
66
66
|
proxy.ts guards /dashboard, finishes Google sign-in
|
|
67
67
|
lib/auth/ server (getAuth, currentUser) and browser (authClient) handles
|
|
68
68
|
lib/db.ts, db/ Postgres via Drizzle, schema, create-if-missing
|
|
69
|
-
components/analytics.tsx loads site analytics when NEXT_PUBLIC_VIBIZ_ANALYTICS_* are set
|
|
70
|
-
components/replay-*.tsx session replay: consent banner, `always` for signed-in users
|
|
71
|
-
lib/replay.ts the consent choice (localStorage) and vibiz('replay', …)
|
|
69
|
+
components/analytics.tsx loads site analytics and session replay when NEXT_PUBLIC_VIBIZ_ANALYTICS_* are set
|
|
72
70
|
app/api/chat, components/chat-box.tsx the AI assistant (streams from the Vibiz AI gateway)
|
|
73
71
|
```
|
|
74
72
|
|
|
@@ -82,7 +80,6 @@ app/api/chat, components/chat-box.tsx the AI assistant (streams from the Vibiz
|
|
|
82
80
|
| `VIBIZ_AUTH_COOKIE_SECRET` | signs the session cookie (32+ chars) |
|
|
83
81
|
| `NEXT_PUBLIC_VIBIZ_ANALYTICS_KEY` | optional: analytics, with the URL below |
|
|
84
82
|
| `NEXT_PUBLIC_VIBIZ_ANALYTICS_URL` | optional: loads `<url>/v1/script.js` |
|
|
85
|
-
| `NEXT_PUBLIC_VIBIZ_REPLAY` | optional: session replay, after consent |
|
|
86
83
|
|
|
87
84
|
The other sign-in variables Vibiz sets (`VIBIZ_AUTH_JWKS_URL`, `VIBIZ_AUTH_PROJECT_ID`, keys) are
|
|
88
85
|
there for code that verifies tokens itself; this app doesn't need them.
|
|
@@ -97,10 +94,12 @@ it and sign in on the live address. Everything else (pages, the database) works
|
|
|
97
94
|
|
|
98
95
|
## Session replay
|
|
99
96
|
|
|
100
|
-
With the `replay` resource (`vibiz add replay`),
|
|
101
|
-
|
|
102
|
-
and
|
|
103
|
-
|
|
104
|
-
recorded
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
With the `replay` resource (`vibiz add replay`), every session is recorded, with no prompt and no
|
|
98
|
+
code in this app: the analytics script starts it. What people type, emails and phone numbers are
|
|
99
|
+
masked, and password and card fields are never in a recording. Mention the recording in your privacy
|
|
100
|
+
policy. Mark anything else private with `data-vibiz-mask` (text hidden) or `data-vibiz-block` (not
|
|
101
|
+
recorded at all).
|
|
102
|
+
|
|
103
|
+
If your visitors need to agree first (the EU, the UK, or a business that wants it), set
|
|
104
|
+
`require_consent: true` on the resource and start recording yourself with `vibiz('replay', 'start')`
|
|
105
|
+
once they do.
|
|
@@ -6,7 +6,6 @@ import { type Note, notes } from '@/db/schema';
|
|
|
6
6
|
import { ChatBox } from '@/components/chat-box';
|
|
7
7
|
import { Header } from '@/components/header';
|
|
8
8
|
import { NotConfigured } from '@/components/not-configured';
|
|
9
|
-
import { ReplaySignedIn } from '@/components/replay-identify';
|
|
10
9
|
import { SignOutButton } from '@/components/sign-out-button';
|
|
11
10
|
import { Button, Input, Notice } from '@/components/ui';
|
|
12
11
|
import { currentUser } from '@/lib/auth/server';
|
|
@@ -51,7 +50,6 @@ export default async function Dashboard() {
|
|
|
51
50
|
|
|
52
51
|
return (
|
|
53
52
|
<Shell signedIn>
|
|
54
|
-
<ReplaySignedIn />
|
|
55
53
|
<section className="flex items-center gap-4 rounded-xl border border-zinc-200 p-6">
|
|
56
54
|
{user.image ? (
|
|
57
55
|
// A plain <img>: avatars come from any host, so next/image would need them all listed.
|
|
@@ -2,7 +2,6 @@ import type { Metadata } from 'next';
|
|
|
2
2
|
import type { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import { site } from '@/app.config';
|
|
4
4
|
import { Analytics } from '@/components/analytics';
|
|
5
|
-
import { ReplayConsent } from '@/components/replay-consent';
|
|
6
5
|
import './globals.css';
|
|
7
6
|
|
|
8
7
|
export const metadata: Metadata = {
|
|
@@ -21,7 +20,6 @@ export default function RootLayout({ children }: { children: ReactNode }) {
|
|
|
21
20
|
<body className="flex min-h-screen flex-col font-sans">
|
|
22
21
|
{children}
|
|
23
22
|
<Analytics />
|
|
24
|
-
<ReplayConsent />
|
|
25
23
|
</body>
|
|
26
24
|
</html>
|
|
27
25
|
);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { site } from '@/app.config';
|
|
2
2
|
import { Header } from '@/components/header';
|
|
3
|
-
import { ReplayChoicesLink } from '@/components/replay-consent';
|
|
4
3
|
import { ButtonLink } from '@/components/ui';
|
|
5
4
|
|
|
6
5
|
const features = [
|
|
@@ -51,11 +50,8 @@ export default function Home() {
|
|
|
51
50
|
</main>
|
|
52
51
|
|
|
53
52
|
<footer className="border-t border-zinc-200">
|
|
54
|
-
<div className="mx-auto
|
|
55
|
-
|
|
56
|
-
© {new Date().getFullYear()} {site.name}
|
|
57
|
-
</span>
|
|
58
|
-
<ReplayChoicesLink />
|
|
53
|
+
<div className="mx-auto max-w-5xl px-6 py-8 text-sm text-zinc-500">
|
|
54
|
+
© {new Date().getFullYear()} {site.name}
|
|
59
55
|
</div>
|
|
60
56
|
</footer>
|
|
61
57
|
</>
|