mirror of
https://github.com/civitai/civitai.git
synced 2026-09-20 22:08:18 +08:00
a92f465aab
Replace the Next.js moderator app with a SvelteKit (adapter-node) app: - spoke auth guard in hooks.server.ts — hub login redirect for no session, civitai.com redirect for authenticated non-moderators, /favicon.svg allowlisted - Kysely read/write DB via @civitai/db/kysely (no Prisma engine, no direct pg dep) - brand-styled landing + prerendered favicon route - env wiring (.env.example) for auth, db, redis, clickhouse, CSAM, NCMEC @civitai/db/kysely: add `sslNoVerify` option (cnpg self-signed cert) and lazy NUMERIC/INT8 type parsers so consumers drop their pg/type-parser boilerplate; registration is per-call so a Prisma-only importer never flips global pg parsing. Docs: per-package READMEs for all 9 @civitai/* packages and docs/packages/new-app-integration.md (bootstrap + data-layer companion to the auth spoke guide). Skill: scaffold-civitai-app — generator that cherry-picks packages into a new app, wiring each one's dep, transpile entry, env, and server shim. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@civitai/email
Transactional email for Civitai apps — a nodemailer-backed sendEmail, plus a small createEmail
HTML builder. No-ops cleanly when SMTP isn't configured.
Add to an app
// package.json
"@civitai/email": "workspace:*"
Transpile (raw TS): Next transpilePackages: ['@civitai/email'], Vite ssr.noExternal: ['@civitai/email'].
Env
All optional — isEmailConfigured() is false when unset and sendEmail becomes a no-op.
| Var | Notes |
|---|---|
EMAIL_HOST |
SMTP host (e.g. smtp.resend.com) |
EMAIL_PORT |
SMTP port |
EMAIL_USER / EMAIL_PASS |
SMTP credentials |
EMAIL_SECURE |
true for TLS-on-connect |
EMAIL_FROM |
default From header |
Use
import { sendEmail, isEmailConfigured, createEmail } from '@civitai/email';
if (isEmailConfigured()) {
await sendEmail({ to, subject, html, text });
}
Gotchas
- Guard sends with
isEmailConfigured()in environments where SMTP may be unset (dev/preview) — otherwise a send is silently dropped. createEmailreturns{ subject, html, text };removeTagsstrips HTML for the text fallback.