ST-cmovs7e3o: web-push dependency + VAPID env vars feature-gated
Voeg web-push + @types/web-push toe aan package.json. Registreer NEXT_PUBLIC_VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPID_SUBJECT en INTERNAL_PUSH_SECRET als .optional() in lib/env.ts. Documenteer alle vier in .env.example en README. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2b1da9f5c4
commit
2f5ea553bc
5 changed files with 127 additions and 166 deletions
11
lib/env.ts
11
lib/env.ts
|
|
@ -9,6 +9,17 @@ const envSchema = z.object({
|
|||
// /api/cron/expire-questions. In productie verplicht; lokaal dev mag missen
|
||||
// (de cron-route geeft 401 als de header niet matcht).
|
||||
CRON_SECRET: z.string().optional(),
|
||||
// PBI-55 Web Push — alle vier .optional() zodat de app ook start zonder VAPID
|
||||
NEXT_PUBLIC_VAPID_PUBLIC_KEY: z.string().optional(),
|
||||
VAPID_PRIVATE_KEY: z.string().optional(),
|
||||
VAPID_SUBJECT: z
|
||||
.string()
|
||||
.refine(
|
||||
(v) => v.startsWith('mailto:') || z.string().email().safeParse(v).success,
|
||||
{ message: 'VAPID_SUBJECT must start with mailto: or be a valid email' }
|
||||
)
|
||||
.optional(),
|
||||
INTERNAL_PUSH_SECRET: z.string().min(32).optional(),
|
||||
})
|
||||
|
||||
const parsed = envSchema.safeParse(process.env)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue