nuxt-backend 0.5.0 → 0.6.0
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/README.md +8 -4
- package/dist/capabilities/registry.js +1 -1
- package/dist/chunks/catalog.mjs +1 -1
- package/dist/chunks/{index.mjs → devtools.mjs} +2 -2
- package/dist/chunks/doctor.mjs +14 -6
- package/dist/chunks/email-previews.mjs +1 -1
- package/dist/chunks/health.mjs +2 -2
- package/dist/chunks/install.mjs +4 -4
- package/dist/chunks/run.mjs +1 -1
- package/dist/chunks/server.mjs +15 -4
- package/dist/cli.mjs +28 -8
- package/dist/convex/access-tickets.d.ts +17 -2
- package/dist/convex/access-tickets.d.ts.map +1 -1
- package/dist/convex/account-data.d.ts +4 -4
- package/dist/convex/account-data.d.ts.map +1 -1
- package/dist/convex/account-data.js +5 -4
- package/dist/convex/account-data.js.map +1 -1
- package/dist/convex/app.d.ts +1 -0
- package/dist/convex/app.d.ts.map +1 -1
- package/dist/convex/app.js +2 -1
- package/dist/convex/app.js.map +1 -1
- package/dist/convex/client/better-auth-options.d.ts.map +1 -1
- package/dist/convex/client/better-auth-options.js +12 -3
- package/dist/convex/client/better-auth-options.js.map +1 -1
- package/dist/convex/client/component.d.ts +4 -0
- package/dist/convex/client/component.d.ts.map +1 -1
- package/dist/convex/client/index.d.ts +5 -0
- package/dist/convex/client/index.d.ts.map +1 -1
- package/dist/convex/client/launch-gate.d.ts.map +1 -1
- package/dist/convex/client/launch-gate.js +30 -1
- package/dist/convex/client/launch-gate.js.map +1 -1
- package/dist/convex/client/plugins.d.ts.map +1 -1
- package/dist/convex/client/plugins.js +3 -0
- package/dist/convex/client/plugins.js.map +1 -1
- package/dist/convex/client/two-factor.d.ts +7 -0
- package/dist/convex/client/two-factor.d.ts.map +1 -0
- package/dist/convex/client/two-factor.js +57 -0
- package/dist/convex/client/two-factor.js.map +1 -0
- package/dist/convex/components/backend/_generated/api.d.ts +2 -0
- package/dist/convex/components/backend/_generated/api.d.ts.map +1 -1
- package/dist/convex/components/backend/_generated/api.js.map +1 -1
- package/dist/convex/components/backend/_generated/component.d.ts +292 -10
- package/dist/convex/components/backend/_generated/component.d.ts.map +1 -1
- package/dist/convex/components/backend/account.d.ts +63 -17
- package/dist/convex/components/backend/account.d.ts.map +1 -1
- package/dist/convex/components/backend/account.js +24 -1
- package/dist/convex/components/backend/account.js.map +1 -1
- package/dist/convex/components/backend/adapter.d.ts.map +1 -1
- package/dist/convex/components/backend/adapter.js +7 -2
- package/dist/convex/components/backend/adapter.js.map +1 -1
- package/dist/convex/components/backend/ai.d.ts +1 -1
- package/dist/convex/components/backend/billing.d.ts +10 -0
- package/dist/convex/components/backend/billing.d.ts.map +1 -1
- package/dist/convex/components/backend/billing.js +2 -1
- package/dist/convex/components/backend/billing.js.map +1 -1
- package/dist/convex/components/backend/commerce.d.ts +229 -0
- package/dist/convex/components/backend/commerce.d.ts.map +1 -0
- package/dist/convex/components/backend/commerce.js +392 -0
- package/dist/convex/components/backend/commerce.js.map +1 -0
- package/dist/convex/components/backend/funnel.d.ts +6 -6
- package/dist/convex/components/backend/jobs.d.ts +1 -1
- package/dist/convex/components/backend/referrals.d.ts +2 -2
- package/dist/convex/components/backend/schema.d.ts +327 -21
- package/dist/convex/components/backend/schema.d.ts.map +1 -1
- package/dist/convex/components/backend/schema.js +108 -1
- package/dist/convex/components/backend/schema.js.map +1 -1
- package/dist/convex/components/backend/waitlist.d.ts +42 -6
- package/dist/convex/components/backend/waitlist.d.ts.map +1 -1
- package/dist/convex/components/backend/waitlist.js +142 -39
- package/dist/convex/components/backend/waitlist.js.map +1 -1
- package/dist/convex/email-templates.d.ts +12 -0
- package/dist/convex/email-templates.d.ts.map +1 -1
- package/dist/convex/email-templates.js +3 -0
- package/dist/convex/email-templates.js.map +1 -1
- package/dist/convex/emails/waitlist-friend-joined.d.ts +9 -0
- package/dist/convex/emails/waitlist-friend-joined.d.ts.map +1 -0
- package/dist/convex/emails/waitlist-friend-joined.js +22 -0
- package/dist/convex/emails/waitlist-friend-joined.js.map +1 -0
- package/dist/convex/errors.d.ts +6 -6
- package/dist/convex/errors.d.ts.map +1 -1
- package/dist/convex/errors.js +14 -2
- package/dist/convex/errors.js.map +1 -1
- package/dist/convex/events.d.ts +19 -0
- package/dist/convex/events.d.ts.map +1 -1
- package/dist/convex/events.js +14 -0
- package/dist/convex/events.js.map +1 -1
- package/dist/convex/integrations/billing/checkout.d.ts +2 -2
- package/dist/convex/integrations/billing/checkout.d.ts.map +1 -1
- package/dist/convex/integrations/billing/checkout.js +79 -11
- package/dist/convex/integrations/billing/checkout.js.map +1 -1
- package/dist/convex/integrations/billing/commerce-entitlements.d.ts +12 -0
- package/dist/convex/integrations/billing/commerce-entitlements.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce-entitlements.js +78 -0
- package/dist/convex/integrations/billing/commerce-entitlements.js.map +1 -0
- package/dist/convex/integrations/billing/commerce-events.d.ts +15 -0
- package/dist/convex/integrations/billing/commerce-events.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce-events.js +433 -0
- package/dist/convex/integrations/billing/commerce-events.js.map +1 -0
- package/dist/convex/integrations/billing/commerce-history.d.ts +20 -0
- package/dist/convex/integrations/billing/commerce-history.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce-history.js +106 -0
- package/dist/convex/integrations/billing/commerce-history.js.map +1 -0
- package/dist/convex/integrations/billing/commerce-webhooks.d.ts +23 -0
- package/dist/convex/integrations/billing/commerce-webhooks.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce-webhooks.js +49 -0
- package/dist/convex/integrations/billing/commerce-webhooks.js.map +1 -0
- package/dist/convex/integrations/billing/commerce.d.ts +100 -0
- package/dist/convex/integrations/billing/commerce.d.ts.map +1 -0
- package/dist/convex/integrations/billing/commerce.js +323 -0
- package/dist/convex/integrations/billing/commerce.js.map +1 -0
- package/dist/convex/integrations/billing/context.d.ts +8 -0
- package/dist/convex/integrations/billing/context.d.ts.map +1 -1
- package/dist/convex/integrations/billing/context.js +14 -2
- package/dist/convex/integrations/billing/context.js.map +1 -1
- package/dist/convex/integrations/billing/credits.d.ts +1 -1
- package/dist/convex/integrations/billing/credits.d.ts.map +1 -1
- package/dist/convex/integrations/billing/credits.js +49 -28
- package/dist/convex/integrations/billing/credits.js.map +1 -1
- package/dist/convex/integrations/billing/customers.d.ts +1 -1
- package/dist/convex/integrations/billing/customers.d.ts.map +1 -1
- package/dist/convex/integrations/billing/customers.js +15 -1
- package/dist/convex/integrations/billing/customers.js.map +1 -1
- package/dist/convex/integrations/billing/entitlements.d.ts +1 -1
- package/dist/convex/integrations/billing/entitlements.d.ts.map +1 -1
- package/dist/convex/integrations/billing/entitlements.js +6 -1
- package/dist/convex/integrations/billing/entitlements.js.map +1 -1
- package/dist/convex/integrations/billing/erasure.d.ts +1 -1
- package/dist/convex/integrations/billing/erasure.d.ts.map +1 -1
- package/dist/convex/integrations/billing/erasure.js +10 -5
- package/dist/convex/integrations/billing/erasure.js.map +1 -1
- package/dist/convex/integrations/billing/free-plan.d.ts +6 -1
- package/dist/convex/integrations/billing/free-plan.d.ts.map +1 -1
- package/dist/convex/integrations/billing/free-plan.js +22 -4
- package/dist/convex/integrations/billing/free-plan.js.map +1 -1
- package/dist/convex/integrations/billing/functions.d.ts +1 -1
- package/dist/convex/integrations/billing/functions.d.ts.map +1 -1
- package/dist/convex/integrations/billing/functions.js +3 -2
- package/dist/convex/integrations/billing/functions.js.map +1 -1
- package/dist/convex/integrations/billing/gifts.d.ts.map +1 -1
- package/dist/convex/integrations/billing/gifts.js +3 -0
- package/dist/convex/integrations/billing/gifts.js.map +1 -1
- package/dist/convex/integrations/billing/history.d.ts +1 -1
- package/dist/convex/integrations/billing/history.d.ts.map +1 -1
- package/dist/convex/integrations/billing/history.js +6 -1
- package/dist/convex/integrations/billing/history.js.map +1 -1
- package/dist/convex/integrations/billing/lifecycle.d.ts +1 -1
- package/dist/convex/integrations/billing/lifecycle.d.ts.map +1 -1
- package/dist/convex/integrations/billing/lifecycle.js +4 -1
- package/dist/convex/integrations/billing/lifecycle.js.map +1 -1
- package/dist/convex/integrations/billing/providers/capabilities.d.ts +17 -0
- package/dist/convex/integrations/billing/providers/capabilities.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/capabilities.js +77 -0
- package/dist/convex/integrations/billing/providers/capabilities.js.map +1 -0
- package/dist/convex/integrations/billing/providers/consent.d.ts +52 -0
- package/dist/convex/integrations/billing/providers/consent.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/consent.js +79 -0
- package/dist/convex/integrations/billing/providers/consent.js.map +1 -0
- package/dist/convex/integrations/billing/providers/creem.d.ts +22 -0
- package/dist/convex/integrations/billing/providers/creem.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/creem.js +208 -0
- package/dist/convex/integrations/billing/providers/creem.js.map +1 -0
- package/dist/convex/integrations/billing/providers/dodo.d.ts +15 -0
- package/dist/convex/integrations/billing/providers/dodo.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/dodo.js +197 -0
- package/dist/convex/integrations/billing/providers/dodo.js.map +1 -0
- package/dist/convex/integrations/billing/providers/http.d.ts +41 -0
- package/dist/convex/integrations/billing/providers/http.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/http.js +146 -0
- package/dist/convex/integrations/billing/providers/http.js.map +1 -0
- package/dist/convex/integrations/billing/providers/index.d.ts +35 -0
- package/dist/convex/integrations/billing/providers/index.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/index.js +62 -0
- package/dist/convex/integrations/billing/providers/index.js.map +1 -0
- package/dist/convex/integrations/billing/providers/stripe.d.ts +28 -0
- package/dist/convex/integrations/billing/providers/stripe.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/stripe.js +327 -0
- package/dist/convex/integrations/billing/providers/stripe.js.map +1 -0
- package/dist/convex/integrations/billing/providers/types.d.ts +263 -0
- package/dist/convex/integrations/billing/providers/types.d.ts.map +1 -0
- package/dist/convex/integrations/billing/providers/types.js +48 -0
- package/dist/convex/integrations/billing/providers/types.js.map +1 -0
- package/dist/convex/integrations/billing/subscriptions.d.ts +1 -1
- package/dist/convex/integrations/billing/subscriptions.d.ts.map +1 -1
- package/dist/convex/integrations/billing/subscriptions.js +20 -6
- package/dist/convex/integrations/billing/subscriptions.js.map +1 -1
- package/dist/convex/integrations/billing/types/setup.d.ts +64 -1
- package/dist/convex/integrations/billing/types/setup.d.ts.map +1 -1
- package/dist/convex/integrations/billing.d.ts +4 -1
- package/dist/convex/integrations/billing.d.ts.map +1 -1
- package/dist/convex/integrations/billing.js +12 -2
- package/dist/convex/integrations/billing.js.map +1 -1
- package/dist/convex/integrations/email.d.ts +1 -1
- package/dist/convex/integrations/email.d.ts.map +1 -1
- package/dist/convex/integrations/email.js.map +1 -1
- package/dist/convex/integrations/launch.d.ts +27 -2
- package/dist/convex/integrations/launch.d.ts.map +1 -1
- package/dist/convex/integrations/launch.js +15 -3
- package/dist/convex/integrations/launch.js.map +1 -1
- package/dist/convex/integrations/presence.d.ts +110 -0
- package/dist/convex/integrations/presence.d.ts.map +1 -0
- package/dist/convex/integrations/presence.js +92 -0
- package/dist/convex/integrations/presence.js.map +1 -0
- package/dist/convex/integrations/waitlist.d.ts +41 -7
- package/dist/convex/integrations/waitlist.d.ts.map +1 -1
- package/dist/convex/integrations/waitlist.js +45 -6
- package/dist/convex/integrations/waitlist.js.map +1 -1
- package/dist/convex/integrations/webhook-guard.d.ts +8 -0
- package/dist/convex/integrations/webhook-guard.d.ts.map +1 -1
- package/dist/convex/integrations/webhook-guard.js +11 -4
- package/dist/convex/integrations/webhook-guard.js.map +1 -1
- package/dist/convex/label-groups/admin.d.ts +9 -0
- package/dist/convex/label-groups/admin.d.ts.map +1 -1
- package/dist/convex/label-groups/admin.js +9 -0
- package/dist/convex/label-groups/admin.js.map +1 -1
- package/dist/convex/label-groups/audit.d.ts +2 -0
- package/dist/convex/label-groups/audit.d.ts.map +1 -1
- package/dist/convex/label-groups/audit.js +2 -0
- package/dist/convex/label-groups/audit.js.map +1 -1
- package/dist/convex/label-groups/auth.d.ts +9 -0
- package/dist/convex/label-groups/auth.d.ts.map +1 -1
- package/dist/convex/label-groups/auth.js +10 -0
- package/dist/convex/label-groups/auth.js.map +1 -1
- package/dist/convex/label-groups/email.d.ts +6 -0
- package/dist/convex/label-groups/email.d.ts.map +1 -1
- package/dist/convex/label-groups/email.js +7 -0
- package/dist/convex/label-groups/email.js.map +1 -1
- package/dist/convex/label-groups/errors.d.ts +4 -0
- package/dist/convex/label-groups/errors.d.ts.map +1 -1
- package/dist/convex/label-groups/errors.js +4 -0
- package/dist/convex/label-groups/errors.js.map +1 -1
- package/dist/convex/label-groups/security.d.ts +19 -0
- package/dist/convex/label-groups/security.d.ts.map +1 -1
- package/dist/convex/label-groups/security.js +20 -0
- package/dist/convex/label-groups/security.js.map +1 -1
- package/dist/convex/label-groups/waitlist.d.ts +8 -0
- package/dist/convex/label-groups/waitlist.d.ts.map +1 -1
- package/dist/convex/label-groups/waitlist.js +9 -0
- package/dist/convex/label-groups/waitlist.js.map +1 -1
- package/dist/convex/label-translations.d.ts.map +1 -1
- package/dist/convex/label-translations.js +24 -0
- package/dist/convex/label-translations.js.map +1 -1
- package/dist/convex/labels.d.ts +57 -0
- package/dist/convex/labels.d.ts.map +1 -1
- package/dist/convex/log.js +2 -0
- package/dist/convex/log.js.map +1 -1
- package/dist/convex/sensitive-actions.d.ts.map +1 -1
- package/dist/convex/sensitive-actions.js +11 -0
- package/dist/convex/sensitive-actions.js.map +1 -1
- package/dist/convex/waitlist-rules.d.ts +63 -9
- package/dist/convex/waitlist-rules.d.ts.map +1 -1
- package/dist/convex/waitlist-rules.js +38 -7
- package/dist/convex/waitlist-rules.js.map +1 -1
- package/dist/devtools-client/_nuxt/DHNi4uhO.js +6 -0
- package/dist/devtools-client/index.html +1 -1
- package/dist/env-registry.js +9 -0
- package/dist/module.d.ts +14 -2
- package/dist/module.js +2 -2
- package/dist/module.json +2 -2
- package/dist/runtime/locales/de.json +58 -1
- package/dist/runtime/locales/en.json +60 -3
- package/dist/runtime/locales/es.json +58 -1
- package/dist/runtime/locales/fr.json +58 -1
- package/dist/runtime/locales/ru.json +58 -1
- package/dist/runtime/server/monitoring/backend-calls.d.ts +3 -3
- package/dist/runtime/server/monitoring/backend-calls.js +2 -2
- package/dist/runtime/server/monitoring/health.js +2 -2
- package/dist/runtime/vue/auth-client.d.ts +3 -2
- package/dist/runtime/vue/auth-client.js +2 -1
- package/dist/runtime/vue/components/account/SecuritySettings.d.vue.ts +25 -2
- package/dist/runtime/vue/components/account/SecuritySettings.vue +52 -2
- package/dist/runtime/vue/components/account/SecuritySettings.vue.d.ts +25 -2
- package/dist/runtime/vue/components/account/SecurityTwoFactor.css +1 -0
- package/dist/runtime/vue/components/account/SecurityTwoFactor.d.vue.ts +4 -0
- package/dist/runtime/vue/components/account/SecurityTwoFactor.vue +107 -0
- package/dist/runtime/vue/components/account/SecurityTwoFactor.vue.d.ts +4 -0
- package/dist/runtime/vue/components/account/security-settings.d.ts +18 -1
- package/dist/runtime/vue/components/admin/AdminUsers.d.vue.ts +11 -2
- package/dist/runtime/vue/components/admin/AdminUsers.vue.d.ts +11 -2
- package/dist/runtime/vue/components/admin/AdminWaitlist.css +1 -1
- package/dist/runtime/vue/components/admin/AdminWaitlistActions.vue +41 -1
- package/dist/runtime/vue/components/admin/AdminWorkspaces.d.vue.ts +9 -0
- package/dist/runtime/vue/components/admin/AdminWorkspaces.vue.d.ts +9 -0
- package/dist/runtime/vue/components/admin/admin-waitlist-tab.js +28 -0
- package/dist/runtime/vue/components/auth/AuthForm.d.vue.ts +9 -0
- package/dist/runtime/vue/components/auth/AuthForm.vue +8 -0
- package/dist/runtime/vue/components/auth/AuthForm.vue.d.ts +9 -0
- package/dist/runtime/vue/components/auth/AuthFormTwoFactor.css +1 -0
- package/dist/runtime/vue/components/auth/AuthFormTwoFactor.d.vue.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormTwoFactor.vue +70 -0
- package/dist/runtime/vue/components/auth/AuthFormTwoFactor.vue.d.ts +3 -0
- package/dist/runtime/vue/components/auth/AuthFormWaitlisted.vue +7 -2
- package/dist/runtime/vue/components/auth/WaitlistForm.d.vue.ts +8 -0
- package/dist/runtime/vue/components/auth/WaitlistForm.vue.d.ts +8 -0
- package/dist/runtime/vue/components/auth/WaitlistPlace.css +1 -1
- package/dist/runtime/vue/components/auth/WaitlistPlace.vue +37 -0
- package/dist/runtime/vue/components/auth/WaitlistShare.vue +2 -2
- package/dist/runtime/vue/components/auth/auth-form.d.ts +2 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.d.vue.ts +2 -0
- package/dist/runtime/vue/components/workspaces/AuditLog.vue.d.ts +2 -0
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.d.vue.ts +2 -2
- package/dist/runtime/vue/components/workspaces/WorkspaceSettings.vue.d.ts +2 -2
- package/dist/runtime/vue/composables/use-login-flow.d.ts +19 -4
- package/dist/runtime/vue/composables/use-login-flow.js +31 -0
- package/dist/runtime/vue/composables/use-room-presence.d.ts +63 -0
- package/dist/runtime/vue/composables/use-room-presence.js +31 -0
- package/dist/runtime/vue/composables/use-two-factor.d.ts +58 -0
- package/dist/runtime/vue/composables/use-two-factor.js +49 -0
- package/dist/runtime/vue/composables/use-waitlist-admin.d.ts +5 -0
- package/dist/runtime/vue/composables/use-waitlist-admin.js +5 -1
- package/dist/runtime/vue/composables/use-waitlist.d.ts +4 -0
- package/dist/runtime/vue/composables/use-waitlist.js +1 -1
- package/dist/runtime/vue/parts.d.ts +8 -1
- package/dist/runtime/vue/two-factor-client.d.ts +15 -0
- package/dist/runtime/vue/two-factor-client.js +19 -0
- package/dist/runtime/vue/utils/auth-session.js +10 -1
- package/dist/runtime/vue/utils/login-bindings.js +1 -0
- package/dist/runtime/vue/utils/page-guard.d.ts +2 -2
- package/dist/runtime/vue/utils/page-guard.js +2 -2
- package/dist/shared/{nuxt-backend.CBvrM7pG.mjs → nuxt-backend.CM_p0XQE.mjs} +1 -1
- package/dist/shared/{nuxt-backend.Dikfaocl.mjs → nuxt-backend.C_Y_BtBs.mjs} +128 -5
- package/dist/shared/{nuxt-backend.DbaXvH__.mjs → nuxt-backend.ChvlbHQq.mjs} +203 -9
- package/dist/shared/{nuxt-backend.BqXAZChe.mjs → nuxt-backend.D16peTIt.mjs} +57 -35
- package/dist/shared/{nuxt-backend.DH1Ya3uB.mjs → nuxt-backend.D4JXvCP6.mjs} +3 -2
- package/dist/types.d.ts +1 -1
- package/package.json +19 -10
- package/skills/nuxt-backend/SKILL.md +18 -18
- package/skills/nuxt-backend/references/api.md +31 -6
- package/skills/nuxt-backend/references/install.md +9 -6
- package/skills/nuxt-backend/references/renames.json +8 -0
- package/skills/nuxt-backend/references/surface.json +62 -2
- package/skills/nuxt-backend-auth/SKILL.md +8 -2
- package/skills/nuxt-backend-auth/references/api.md +3 -1
- package/skills/nuxt-backend-billing/SKILL.md +15 -0
- package/skills/nuxt-backend-billing/references/api.md +14 -1
- package/skills/nuxt-backend-data/SKILL.md +1 -0
- package/skills/nuxt-backend-data/references/api.md +10 -1
- package/skills/nuxt-backend-email/references/api.md +1 -1
- package/skills/nuxt-backend-ship/SKILL.md +2 -1
- package/skills/nuxt-backend-upgrade/references/upgrade.md +6 -0
- package/src/convex/access-tickets.ts +10 -2
- package/src/convex/account-data.ts +5 -4
- package/src/convex/app.ts +2 -1
- package/src/convex/client/better-auth-options.ts +12 -3
- package/src/convex/client/launch-gate.ts +28 -1
- package/src/convex/client/plugins.ts +3 -0
- package/src/convex/client/two-factor.ts +66 -0
- package/src/convex/components/backend/_generated/api.ts +2 -0
- package/src/convex/components/backend/_generated/component.ts +500 -2
- package/src/convex/components/backend/account.ts +25 -1
- package/src/convex/components/backend/adapter.ts +7 -2
- package/src/convex/components/backend/billing.ts +2 -1
- package/src/convex/components/backend/commerce.ts +408 -0
- package/src/convex/components/backend/schema.ts +110 -1
- package/src/convex/components/backend/waitlist.ts +144 -40
- package/src/convex/email-templates.ts +16 -0
- package/src/convex/emails/waitlist-friend-joined.ts +23 -0
- package/src/convex/errors.ts +15 -2
- package/src/convex/events.ts +14 -0
- package/src/convex/integrations/billing/checkout.ts +78 -11
- package/src/convex/integrations/billing/commerce-entitlements.ts +92 -0
- package/src/convex/integrations/billing/commerce-events.ts +487 -0
- package/src/convex/integrations/billing/commerce-history.ts +110 -0
- package/src/convex/integrations/billing/commerce-webhooks.ts +69 -0
- package/src/convex/integrations/billing/commerce.ts +366 -0
- package/src/convex/integrations/billing/context.ts +19 -2
- package/src/convex/integrations/billing/credits.ts +47 -27
- package/src/convex/integrations/billing/customers.ts +15 -1
- package/src/convex/integrations/billing/entitlements.ts +5 -1
- package/src/convex/integrations/billing/erasure.ts +11 -6
- package/src/convex/integrations/billing/free-plan.ts +30 -5
- package/src/convex/integrations/billing/functions.ts +3 -2
- package/src/convex/integrations/billing/gifts.ts +2 -0
- package/src/convex/integrations/billing/history.ts +9 -0
- package/src/convex/integrations/billing/lifecycle.ts +3 -1
- package/src/convex/integrations/billing/providers/capabilities.ts +78 -0
- package/src/convex/integrations/billing/providers/consent.ts +94 -0
- package/src/convex/integrations/billing/providers/creem.ts +225 -0
- package/src/convex/integrations/billing/providers/dodo.ts +214 -0
- package/src/convex/integrations/billing/providers/http.ts +168 -0
- package/src/convex/integrations/billing/providers/index.ts +65 -0
- package/src/convex/integrations/billing/providers/stripe.ts +345 -0
- package/src/convex/integrations/billing/providers/types.ts +281 -0
- package/src/convex/integrations/billing/subscriptions.ts +20 -6
- package/src/convex/integrations/billing/types/setup.ts +63 -1
- package/src/convex/integrations/billing.ts +46 -3
- package/src/convex/integrations/email.ts +1 -0
- package/src/convex/integrations/launch.ts +45 -7
- package/src/convex/integrations/presence.ts +160 -0
- package/src/convex/integrations/waitlist.ts +84 -12
- package/src/convex/integrations/webhook-guard.ts +20 -4
- package/src/convex/label-groups/admin.ts +9 -0
- package/src/convex/label-groups/audit.ts +2 -0
- package/src/convex/label-groups/auth.ts +10 -0
- package/src/convex/label-groups/email.ts +7 -0
- package/src/convex/label-groups/errors.ts +4 -0
- package/src/convex/label-groups/security.ts +20 -0
- package/src/convex/label-groups/waitlist.ts +9 -0
- package/src/convex/label-translations.ts +24 -0
- package/src/convex/log.ts +2 -0
- package/src/convex/sensitive-actions.ts +11 -0
- package/src/convex/waitlist-rules.ts +84 -8
- package/src/runtime/vue/components/account/SecuritySettings.vue +58 -4
- package/src/runtime/vue/components/account/SecurityTwoFactor.css +68 -0
- package/src/runtime/vue/components/account/SecurityTwoFactor.vue +113 -0
- package/src/runtime/vue/components/admin/AdminWaitlist.css +1 -0
- package/src/runtime/vue/components/admin/AdminWaitlistActions.vue +44 -2
- package/src/runtime/vue/components/auth/AuthForm.vue +8 -0
- package/src/runtime/vue/components/auth/AuthFormTwoFactor.css +40 -0
- package/src/runtime/vue/components/auth/AuthFormTwoFactor.vue +75 -0
- package/src/runtime/vue/components/auth/AuthFormWaitlisted.vue +11 -4
- package/src/runtime/vue/components/auth/WaitlistPlace.css +16 -0
- package/src/runtime/vue/components/auth/WaitlistPlace.vue +49 -2
- package/src/runtime/vue/components/auth/WaitlistShare.vue +4 -3
- package/dist/devtools-client/_nuxt/CiCAOwUc.js +0 -5
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "Every public name a release renamed, reshaped or removed, with the Upgrade page section that explains it. `npx nuxt-backend upgrade` rewrites none of an app's code: the edit is yours. Generated by `pnpm generate` (scripts/agent-guidance.mjs). Do not edit: change the code it reads.",
|
|
3
3
|
"renames": [
|
|
4
|
+
{
|
|
5
|
+
"from": "^4.6.2",
|
|
6
|
+
"to": "^4.7.0",
|
|
7
|
+
"change": "reshaped",
|
|
8
|
+
"section": "The module requires Nuxt 4.7.0",
|
|
9
|
+
"note": "the module's Nuxt compatibility: Nuxt 4.6 no longer builds with Vite 8.4, so move the app to Nuxt 4.7.0 or later",
|
|
10
|
+
"url": "https://nuxt-backend.dev/docs/ship/releases/upgrade#the-module-requires-nuxt-470"
|
|
11
|
+
},
|
|
4
12
|
{
|
|
5
13
|
"from": "api",
|
|
6
14
|
"to": "_generated/api.d.ts",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"AccessDeniedData",
|
|
10
10
|
"AccessDeniedReason",
|
|
11
11
|
"AdminTabMeta",
|
|
12
|
+
"AuthProvider",
|
|
12
13
|
"BackendAuthOptions",
|
|
13
14
|
"BackendAuthService",
|
|
14
15
|
"InstallableOptions",
|
|
@@ -116,9 +117,22 @@
|
|
|
116
117
|
"nuxt-backend/billing": {
|
|
117
118
|
"values": [
|
|
118
119
|
"ALL_BILLING_EVENTS",
|
|
120
|
+
"DIGITAL_CONTENT_CONSENT_TEXT",
|
|
121
|
+
"DIGITAL_CONTENT_CONSENT_VERSION",
|
|
122
|
+
"PROVIDER_CAPABILITIES",
|
|
123
|
+
"ProviderHttpError",
|
|
124
|
+
"ProviderUnsupportedError",
|
|
125
|
+
"billingProviderName",
|
|
126
|
+
"commerceProviderFromEnv",
|
|
127
|
+
"consentFromMetadata",
|
|
128
|
+
"consentMetadata",
|
|
129
|
+
"createCommerceProvider",
|
|
130
|
+
"createCommerceWebhookHandler",
|
|
119
131
|
"defineBillingCatalog",
|
|
132
|
+
"recordDigitalContentConsent",
|
|
120
133
|
"setupBilling",
|
|
121
|
-
"setupReferrals"
|
|
134
|
+
"setupReferrals",
|
|
135
|
+
"webhookSecretsFromEnv"
|
|
122
136
|
],
|
|
123
137
|
"types": [
|
|
124
138
|
"AccountBillingErasure",
|
|
@@ -144,6 +158,7 @@
|
|
|
144
158
|
"BillingLifecycle",
|
|
145
159
|
"BillingOrder",
|
|
146
160
|
"BillingPage",
|
|
161
|
+
"BillingProviderName",
|
|
147
162
|
"BillingRateLimiter",
|
|
148
163
|
"BillingWebhookEventHandlers",
|
|
149
164
|
"CampaignAttribution",
|
|
@@ -168,15 +183,24 @@
|
|
|
168
183
|
"CatalogPlanGift",
|
|
169
184
|
"CatalogPlanPrices",
|
|
170
185
|
"CatalogQuota",
|
|
186
|
+
"ChangePlanRequest",
|
|
187
|
+
"CheckoutCustomer",
|
|
171
188
|
"CheckoutOptions",
|
|
172
189
|
"CheckoutPrefill",
|
|
190
|
+
"CheckoutRequest",
|
|
191
|
+
"CheckoutSession",
|
|
173
192
|
"CheckoutTrial",
|
|
174
193
|
"ClaimRefusal",
|
|
175
194
|
"ClientProrationBehavior",
|
|
195
|
+
"CommerceConfig",
|
|
196
|
+
"CommerceEventHandler",
|
|
197
|
+
"CommerceProvider",
|
|
198
|
+
"CommerceWebhookOptions",
|
|
176
199
|
"CostReport",
|
|
177
200
|
"CreditMeterConfig",
|
|
178
201
|
"CurrentSubscriptions",
|
|
179
202
|
"CustomerEntitlements",
|
|
203
|
+
"DigitalContentConsent",
|
|
180
204
|
"DiscountInput",
|
|
181
205
|
"DiscountListOptions",
|
|
182
206
|
"DueReferral",
|
|
@@ -186,8 +210,14 @@
|
|
|
186
210
|
"FeatureCheckOptions",
|
|
187
211
|
"GiftRecord",
|
|
188
212
|
"GiftTask",
|
|
213
|
+
"InvoiceAnswer",
|
|
189
214
|
"MeterUnit",
|
|
190
215
|
"MeterUsage",
|
|
216
|
+
"NeutralBillingEvent",
|
|
217
|
+
"NeutralOrder",
|
|
218
|
+
"NeutralRefund",
|
|
219
|
+
"NeutralSubscription",
|
|
220
|
+
"NeutralSubscriptionStatus",
|
|
191
221
|
"OrdersOptions",
|
|
192
222
|
"PauseSubscriptionOptions",
|
|
193
223
|
"PricedCredits",
|
|
@@ -201,6 +231,9 @@
|
|
|
201
231
|
"PricedTrial",
|
|
202
232
|
"Pricing",
|
|
203
233
|
"ProrationBehavior",
|
|
234
|
+
"ProviderCapabilities",
|
|
235
|
+
"ProviderEnvironment",
|
|
236
|
+
"ProviderOptions",
|
|
204
237
|
"QuotaUsage",
|
|
205
238
|
"ReferralCaps",
|
|
206
239
|
"ReferralCodeView",
|
|
@@ -226,6 +259,7 @@
|
|
|
226
259
|
"RefundOrderOptions",
|
|
227
260
|
"RefundReason",
|
|
228
261
|
"RefundRecord",
|
|
262
|
+
"RefundRequest",
|
|
229
263
|
"RevenueCancellations",
|
|
230
264
|
"RevenueInterval",
|
|
231
265
|
"RevenueMetric",
|
|
@@ -246,6 +280,7 @@
|
|
|
246
280
|
"UpdateSubscriptionOptions",
|
|
247
281
|
"UsageEvent",
|
|
248
282
|
"UsageHistoryOptions",
|
|
283
|
+
"VerifiedDelivery",
|
|
249
284
|
"WithdrawalPeriod"
|
|
250
285
|
]
|
|
251
286
|
},
|
|
@@ -358,10 +393,23 @@
|
|
|
358
393
|
"TrustedHtml",
|
|
359
394
|
"WaitlistAdmittedEmailData",
|
|
360
395
|
"WaitlistConfirmationEmailData",
|
|
396
|
+
"WaitlistFriendJoinedEmailData",
|
|
361
397
|
"WelcomeEmailData",
|
|
362
398
|
"WithdrawalReceiptEmailData"
|
|
363
399
|
]
|
|
364
400
|
},
|
|
401
|
+
"nuxt-backend/presence": {
|
|
402
|
+
"values": [
|
|
403
|
+
"setupPresence"
|
|
404
|
+
],
|
|
405
|
+
"types": [
|
|
406
|
+
"PresenceComponents",
|
|
407
|
+
"PresenceRoomCheck",
|
|
408
|
+
"PresenceSetup",
|
|
409
|
+
"RoomMember",
|
|
410
|
+
"SetupPresenceOptions"
|
|
411
|
+
]
|
|
412
|
+
},
|
|
365
413
|
"nuxt-backend/rate-limit": {
|
|
366
414
|
"values": [
|
|
367
415
|
"DAY",
|
|
@@ -458,13 +506,18 @@
|
|
|
458
506
|
"SetupWaitlistOptions",
|
|
459
507
|
"Waitlist",
|
|
460
508
|
"WaitlistApi",
|
|
509
|
+
"WaitlistBoostOptions",
|
|
510
|
+
"WaitlistBoostRule",
|
|
461
511
|
"WaitlistCaps",
|
|
462
512
|
"WaitlistConsole",
|
|
463
513
|
"WaitlistEntryRow",
|
|
514
|
+
"WaitlistOptions",
|
|
464
515
|
"WaitlistPlace",
|
|
465
516
|
"WaitlistQuestions",
|
|
517
|
+
"WaitlistRule",
|
|
466
518
|
"WaitlistStatus",
|
|
467
|
-
"WaitlistStatusView"
|
|
519
|
+
"WaitlistStatusView",
|
|
520
|
+
"WaitlistWaveStanding"
|
|
468
521
|
]
|
|
469
522
|
},
|
|
470
523
|
"nuxt-backend/account": {
|
|
@@ -938,11 +991,13 @@
|
|
|
938
991
|
"useReportAppeal",
|
|
939
992
|
"useReportForm",
|
|
940
993
|
"useReturnPath",
|
|
994
|
+
"useRoomPresence",
|
|
941
995
|
"useSandboxInbox",
|
|
942
996
|
"useSearch",
|
|
943
997
|
"useSessions",
|
|
944
998
|
"useShareLink",
|
|
945
999
|
"useSignInAlerts",
|
|
1000
|
+
"useTwoFactor",
|
|
946
1001
|
"useUploadField",
|
|
947
1002
|
"useUsage",
|
|
948
1003
|
"useWaitlist",
|
|
@@ -1016,6 +1071,7 @@
|
|
|
1016
1071
|
"AuthFormPasskey",
|
|
1017
1072
|
"AuthFormPasskeyOffer",
|
|
1018
1073
|
"AuthFormRecover",
|
|
1074
|
+
"AuthFormTwoFactor",
|
|
1019
1075
|
"AuthFormUndeliverable",
|
|
1020
1076
|
"AuthFormWaitlisted",
|
|
1021
1077
|
"BillingHistoryOrder",
|
|
@@ -1046,6 +1102,7 @@
|
|
|
1046
1102
|
"SecurityAlerts",
|
|
1047
1103
|
"SecurityPasskeys",
|
|
1048
1104
|
"SecuritySessions",
|
|
1105
|
+
"SecurityTwoFactor",
|
|
1049
1106
|
"UsageHistoryEvent",
|
|
1050
1107
|
"WaitlistCode",
|
|
1051
1108
|
"WaitlistJoin",
|
|
@@ -1280,6 +1337,7 @@
|
|
|
1280
1337
|
"consent-urls": "auth",
|
|
1281
1338
|
"admin-bootstrap": "auth",
|
|
1282
1339
|
"page-paths": "auth",
|
|
1340
|
+
"auth-provider": "auth",
|
|
1283
1341
|
"backend-site-url": "data",
|
|
1284
1342
|
"deployment-env": "data",
|
|
1285
1343
|
"deployment-backend-environment": "data",
|
|
@@ -1391,6 +1449,7 @@
|
|
|
1391
1449
|
],
|
|
1392
1450
|
"jobs": [],
|
|
1393
1451
|
"billing": [
|
|
1452
|
+
"BILLING_PROVIDER",
|
|
1394
1453
|
"BILLING_ACCESS_TOKEN",
|
|
1395
1454
|
"BILLING_WEBHOOK_SECRET"
|
|
1396
1455
|
],
|
|
@@ -1437,6 +1496,7 @@
|
|
|
1437
1496
|
"EMAIL_REGION": "optional",
|
|
1438
1497
|
"EMAIL_WEBHOOK_SECRET": "optional",
|
|
1439
1498
|
"EMAIL_DEV_INBOX": "dev-only",
|
|
1499
|
+
"BILLING_PROVIDER": "optional",
|
|
1440
1500
|
"BILLING_ACCESS_TOKEN": "optional",
|
|
1441
1501
|
"BILLING_WEBHOOK_SECRET": "optional",
|
|
1442
1502
|
"AI_GATEWAY_API_KEY": "optional",
|
|
@@ -5,8 +5,9 @@ description: Sign-in, sessions and access control in a Nuxt app on nuxt-backend.
|
|
|
5
5
|
|
|
6
6
|
# nuxt-backend: auth and workspaces
|
|
7
7
|
|
|
8
|
-
Sign-in is passwordless: email codes and passkeys,
|
|
9
|
-
workspace on first sign-in, so a session
|
|
8
|
+
Sign-in is passwordless: email codes and passkeys, and an authenticator app after a code for an
|
|
9
|
+
account that turns one on. Every user gets a personal workspace on first sign-in, so a session
|
|
10
|
+
always has an active one. The `nuxt-backend` core skill
|
|
10
11
|
holds the rules every change follows; this one covers who the caller is and what they may do.
|
|
11
12
|
|
|
12
13
|
## Sign-in and pages
|
|
@@ -53,6 +54,10 @@ holds the rules every change follows; this one covers who the caller is and what
|
|
|
53
54
|
`error` and `retryAfter`.
|
|
54
55
|
- A banned account's sign-in is `forbidden` with reason `banned`.
|
|
55
56
|
- `useSessions()` lists the account's signed-in devices and revokes one by id.
|
|
57
|
+
- `useTwoFactor()` turns the authenticator app on (`start`, then `confirm` with its first code),
|
|
58
|
+
off, and makes new backup codes; wrap each in `withReauthentication`. A code sign-in of such an
|
|
59
|
+
account rejects with `forbidden`, reason `two_factor_required`, and `verifyTwoFactor` finishes it;
|
|
60
|
+
`useLoginFlow` moves to its `two-factor` step by itself. A passkey sign-in asks for no second step.
|
|
56
61
|
|
|
57
62
|
## Functions
|
|
58
63
|
|
|
@@ -157,6 +162,7 @@ exact paths only.
|
|
|
157
162
|
- [Record and review activity](https://nuxt-backend.dev/docs/build/auth/admin/audit-log): The activity trail: what the package records, who reads which part of it, events of your own with recordBackendEvent, onEvent, a year of retention and erasure. Reach for `nuxt-backend/audit`.
|
|
158
163
|
- [Add your own admin tabs](https://nuxt-backend.dev/docs/build/auth/admin/custom-tabs): Put the tools your team runs the app with inside the admin console: a page under app/pages/admin/ becomes a tab beside the built-in ones, guarded like the console, hidden from everyone else, and backed by admin-tier functions.
|
|
159
164
|
- [Run the admin console](https://nuxt-backend.dev/docs/build/auth/admin): Make the first administrator, then run /admin: every account and workspace, bans, roles, signed-out devices and impersonation, the activity trail, flags and system health, with useAdmin, `<AdminUsers>`, setupAdmin and tabs of your own. Reach for `nuxt-backend/admin`.
|
|
165
|
+
- [Sign in with Convex auth](https://nuxt-backend.dev/docs/build/auth/convex-auth): Run Convex Auth in place of Better Auth: sign-in only, through the base module's @convex-dev/auth integration, with the package's pages, page guard, workspaces, billing, AI credits and account features off.
|
|
160
166
|
- [Run a waitlist](https://nuxt-backend.dev/docs/build/growth/launch/waitlist): A verified waitlist for early access: joins proven by an email code, a public position with a referral boost, launch news only for those who opted in, admission in waves from the admin console, and a launch that opens the doors. Reach for `setupWaitlist()` from `nuxt-backend/access`.
|
|
161
167
|
- [Hand out invite codes and access links](https://nuxt-backend.dev/docs/build/growth/launch/invites): While your app is in early access or invite only, administrators admit people from the console's Access tab: invite codes to share, access links for a whole cohort, invitations by address with no email unless asked, and useInvite to redeem them. Reach for `nuxt-backend/access`.
|
|
162
168
|
- [Launch in phases](https://nuxt-backend.dev/docs/build/growth/launch): Open your app in three phases, early access with a waitlist, then invite only, then public: setupAccess, the tickets that admit a new address, useAccessPhase on your pages, and a phase you change from the admin console with no deploy. Reach for `nuxt-backend/access`.
|
|
@@ -17,6 +17,7 @@ core skill, `nuxt-backend`, lists every public name in its own `references/api.m
|
|
|
17
17
|
| `useEmailChange()` | The headless email change behind `<ProfileSettings>`: a code from the current address proves the person asking still holds it, a code from the new address proves they hold that one too. |
|
|
18
18
|
| `useWorkspace()` | Workspace state and actions: the list, the switch, the members and the full invitation flow (invite / accept / decline / cancel — the packaged `AcceptInvitation` component and `/accept-invitation` page build on these). |
|
|
19
19
|
| `usePasskeys()` | Passkey management over the auth client — list, register, rename, remove. |
|
|
20
|
+
| `useTwoFactor()` | The authenticator app as a second step after a sign-in code (TOTP), for the signed-in account: turn it on (`start`, then `confirm` with the app's first code), off, and new backup codes. |
|
|
20
21
|
| `useSessions()` | Device-session management: list, revoke one, revoke the rest. |
|
|
21
22
|
| `useSignInAlerts()` | What an account shows around its sign-ins, without the markup: the latest sign-ins from a device it had not used before, and with its recovery code (the ones the person is also emailed about), each with its device and time, and a button that signs that session out while it is still signed in and is not this browser's. |
|
|
22
23
|
| `useHumanCheck()` | Proof that a person makes a call: the client half of `verifyHuman`, for the calls that reach the deployment over the live connection and never pass through the app's server (a waitlist join, a contact form, a referral claim). |
|
|
@@ -84,7 +85,7 @@ Types: `BackendPaths`, `DefineBackendAuthConfigOptions`.
|
|
|
84
85
|
| `setupWaitlist()` | Run a waitlist for early access: joins proven by the sign-in code (the double opt-in), a place for everyone waiting, a boost for each friend who joins through their link, waves an administrator admits from the console's Waitlist tab, and a mirror of the people who asked for launch news to the email provider. |
|
|
85
86
|
| `ACCESS_PHASES` | Every launch phase, in order: an app lists the ones it goes through. |
|
|
86
87
|
|
|
87
|
-
Types: `AccessCtx`, `AccessWriteCtx`, `AccessPhaseState`, `AccessInvite`, `AccessMemberTicket`, `AccessAdmission`, `AccessConsole`, `AdmitResult`, `AccessApi`, `MemberTicket`, `MemberTicketsOptions`, `MemberTicketsApi`, `MemberTickets`, `Access`, `SetupAccessOptions`, `AccessEmail`, `AccessComponents`, `SetupWaitlistOptions`, `Waitlist`, `WaitlistApi`, `WaitlistCaps`, `WaitlistConsole`, `WaitlistEntryRow`, `WaitlistPlace`, `WaitlistStatusView`, `WaitlistQuestions`, `WaitlistStatus`, `AccessPhase`, `AccessTicket`, `InviteKind`, `InviteStatus`.
|
|
88
|
+
Types: `AccessCtx`, `AccessWriteCtx`, `AccessPhaseState`, `AccessInvite`, `AccessMemberTicket`, `AccessAdmission`, `AccessConsole`, `AdmitResult`, `AccessApi`, `MemberTicket`, `MemberTicketsOptions`, `MemberTicketsApi`, `MemberTickets`, `Access`, `SetupAccessOptions`, `AccessEmail`, `AccessComponents`, `SetupWaitlistOptions`, `Waitlist`, `WaitlistApi`, `WaitlistCaps`, `WaitlistConsole`, `WaitlistEntryRow`, `WaitlistPlace`, `WaitlistStatusView`, `WaitlistWaveStanding`, `WaitlistBoostOptions`, `WaitlistBoostRule`, `WaitlistOptions`, `WaitlistQuestions`, `WaitlistRule`, `WaitlistStatus`, `AccessPhase`, `AccessTicket`, `InviteKind`, `InviteStatus`.
|
|
88
89
|
|
|
89
90
|
### `nuxt-backend/audit`
|
|
90
91
|
|
|
@@ -147,6 +148,7 @@ Let addresses sign up while the app is closed: an invitation by address each, as
|
|
|
147
148
|
| `consent-urls` | auth | Consent documents |
|
|
148
149
|
| `admin-bootstrap` | auth | First administrator |
|
|
149
150
|
| `page-paths` | auth | Page paths |
|
|
151
|
+
| `auth-provider` | auth | Auth provider |
|
|
150
152
|
| `bot-protection` | protection | Bot protection |
|
|
151
153
|
| `protection-proof` | protection | Bot-check proof |
|
|
152
154
|
| `protection-challenge-keys` | protection | Challenge keys |
|
|
@@ -60,6 +60,21 @@ credits and gifts.
|
|
|
60
60
|
`billing-customer-mapping`. On a dev deployment, run `npx nuxt-backend billing reset` (sync,
|
|
61
61
|
clear, free plan again); never clear the tables by hand.
|
|
62
62
|
|
|
63
|
+
## Stripe, Dodo or Creem instead of Polar
|
|
64
|
+
|
|
65
|
+
- `BILLING_PROVIDER=stripe|dodo|creem` sells through that merchant of record, and then
|
|
66
|
+
`setupBilling` needs `commerce: { definition, products: { sandbox, production } }`: the catalog's
|
|
67
|
+
default export and the provider's ids by catalog key (`pro`, `pro:year`, a pack's key; Stripe's
|
|
68
|
+
price ids, Dodo's and Creem's product ids). `billing sync` is Polar's only: create the products
|
|
69
|
+
in the provider's dashboard, then run `npx convex run billing:syncProducts` after each deploy.
|
|
70
|
+
- The same composables, credits, quotas, checkout and `/billing/events` route run on it; the
|
|
71
|
+
component keeps the credit ledger and the orders. The free plan is the app's own there: no
|
|
72
|
+
subscription row (`subscription` is null, `isFree` true). React to events with
|
|
73
|
+
`commerce.onEvent`, idempotent.
|
|
74
|
+
- Gifts, passes, catalog discounts, save offers, the reverse trial, usage history, revenue and
|
|
75
|
+
referral rewards are Polar's for now: they refuse with `unavailable` (reason
|
|
76
|
+
`provider_unsupported`). See https://nuxt-backend.dev/docs/services/merchants.
|
|
77
|
+
|
|
63
78
|
## Reading state and gating
|
|
64
79
|
|
|
65
80
|
- Read state with `useBilling()`, `useFeatures()` and `useCredits({ meter: 'credits' })`, gate UI
|
|
@@ -43,10 +43,23 @@ core skill, `nuxt-backend`, lists every public name in its own `references/api.m
|
|
|
43
43
|
|---|---|
|
|
44
44
|
| `defineBillingCatalog()` | Declare the billing catalog (typed identity: its keys stay literal, so `keyof typeof catalog.discounts` names its promotions). |
|
|
45
45
|
| `ALL_BILLING_EVENTS` | The provider's full webhook catalog. |
|
|
46
|
+
| `billingProviderName()` | The provider `BILLING_PROVIDER` names, `polar` when it is unset. |
|
|
47
|
+
| `commerceProviderFromEnv()` | The adapter the deployment's env names: `BILLING_PROVIDER`, the key in `BILLING_ACCESS_TOKEN`, and the provider's sandbox everywhere but production. |
|
|
48
|
+
| `consentFromMetadata()` | The proof an order's metadata carries back in a webhook, or `null` when the checkout had none. |
|
|
49
|
+
| `consentMetadata()` | The proof as checkout metadata. |
|
|
50
|
+
| `createCommerceProvider()` | The adapter for `name`. |
|
|
51
|
+
| `DIGITAL_CONTENT_CONSENT_TEXT` | The checkbox's text, in English. |
|
|
52
|
+
| `DIGITAL_CONTENT_CONSENT_VERSION` | The version of the wording below: bump it whenever the text changes, so a record names what was shown. |
|
|
53
|
+
| `PROVIDER_CAPABILITIES` | What each provider's API offers, checked against its docs on 2026-11-24. |
|
|
54
|
+
| `ProviderHttpError` | A provider's HTTP answer that was not a success. |
|
|
55
|
+
| `ProviderUnsupportedError` | A call a provider's API does not offer: the app shows the dashboard or the portal instead. |
|
|
56
|
+
| `recordDigitalContentConsent()` | The proof for a checkout of digital content, from what the page sent: it refuses unless `accepted` is the literal `true` (a pre-ticked box or a missing field is no consent), and hashes the text the page showed. |
|
|
57
|
+
| `webhookSecretsFromEnv()` | The webhook secrets the env accepts: a rotation list, first entry primary. |
|
|
58
|
+
| `createCommerceWebhookHandler()` | The handler an app passes as `billing.webhookHandler` to `registerBackendRoutes` for an adapter provider. |
|
|
46
59
|
| `setupReferrals()` | Set the referral program up in its own backend file (`backend/referrals.ts`). |
|
|
47
60
|
| `setupBilling()` | Configure billing for subscriptions, discounts, prepaid credits, and gift purchases — linked to your auth users and cached reactively inside the `backend` component (so consumers add nothing to their own schema). |
|
|
48
61
|
|
|
49
|
-
Types: `BillingRateLimiter`, `DiscountInput`, `ProrationBehavior`, `ClientProrationBehavior`, `CancellationReason`, `RefundReason`, `SubscriptionTarget`, `UpdateSubscriptionOptions`, `CancelSubscriptionOptions`, `PauseSubscriptionOptions`, `CurrentSubscriptions`, `OrdersOptions`, `BillingOrder`, `BillingPage`, `UsageHistoryOptions`, `UsageEvent`, `RefundOrderOptions`, `RefundRecord`, `DiscountListOptions`, `BillingDiscounts`, `ApplyDiscountOptions`, `CheckoutPrefill`, `CampaignAttribution`, `CheckoutTrial`, `CheckoutOptions`, `ServerCheckoutOptions`, `FeatureCheckOptions`, `BenefitKind`, `EntitlementBenefit`, `EntitlementMeter`, `CustomerEntitlements`, `CreditMeterConfig`, `BillingCatalogIds`, `CatalogPassIds`, `BillingCatalogDiscount`, `SpendCreditsEvent`, `SpendReservation`, `RefundCreditsEvent`, `CostReport`, `GiftRecord`, `GiftTask`, `PricedCredits`, `PricedTrial`, `PricedPlanPrice`, `PricedPlan`, `PricedPlanGift`, `PricedGiftLength`, `PricedPack`, `PricedOffer`, `PricedPromotion`, `Pricing`, `QuotaUsage`, `BillingWebhookEventHandlers`, `SaveOfferTerms`, `BillingComponents`, `BillingEmail`, `BillingEntity`, `BillingAccessRule`, `BillingEntityCtx`, `EntityProfile`, `SetupBillingConfig`, `AccountBillingErasure`, `AccountBillingErasureInput`, `AccountBillingExport`, `AccountBillingRecord`, `Billing`, `BillingAudit`, `BillingLifecycle`, `CancelFlowState`, `CancelOutcome`, `BillingConsole`, `SaveOffer`, `SaveOfferRule`, `WithdrawalPeriod`, `MeterUsage`, `RevenueCancellations`, `RevenueInterval`, `RevenueMetric`, `RevenueOptions`, `RevenuePeriod`, `RevenueReport`, `RevenueValues`, `BillingCatalog`, `CatalogCreditGrant`, `CatalogCurrencyPrices`, `CatalogDiscount`, `CatalogDiscountDuration`, `CatalogDiscountProducts`, `CatalogDiscountTerms`, `CatalogFeature`, `CatalogInterval`, `CatalogMeter`, `CatalogPack`, `CatalogPackPrices`, `CatalogPlan`, `CatalogPlanCreditGrant`, `CatalogPlanGift`, `CatalogPlanPrices`, `CatalogQuota`, `MeterUnit`, `BillingLaunch`, `BillingLaunchReason`, `ClaimRefusal`, `DueReferral`, `ReferralCodeView`, `ReferralComponents`, `ReferralRefs`, `ReferralConsole`, `ReferralConsoleRow`, `ReferralConsoleRows`, `ReferralEntry`, `ReferralPreview`, `ReferralProgram`, `Referrals`, `ReferralsApi`, `ReferralsView`, `ReferredOffer`, `ReferrerOffer`, `SetupReferralsOptions`, `StoredTerms`, `ReferralCaps`, `ReferralRewards`, `ReferralState`, `ReferralTerms`, `ReferredReward`, `ReferrerReward`.
|
|
62
|
+
Types: `BillingRateLimiter`, `DiscountInput`, `ProrationBehavior`, `ClientProrationBehavior`, `CancellationReason`, `RefundReason`, `SubscriptionTarget`, `UpdateSubscriptionOptions`, `CancelSubscriptionOptions`, `PauseSubscriptionOptions`, `CurrentSubscriptions`, `OrdersOptions`, `BillingOrder`, `BillingPage`, `UsageHistoryOptions`, `UsageEvent`, `RefundOrderOptions`, `RefundRecord`, `DiscountListOptions`, `BillingDiscounts`, `ApplyDiscountOptions`, `CheckoutPrefill`, `CampaignAttribution`, `CheckoutTrial`, `CheckoutOptions`, `ServerCheckoutOptions`, `FeatureCheckOptions`, `BenefitKind`, `EntitlementBenefit`, `EntitlementMeter`, `CustomerEntitlements`, `CreditMeterConfig`, `BillingCatalogIds`, `CatalogPassIds`, `BillingCatalogDiscount`, `SpendCreditsEvent`, `SpendReservation`, `RefundCreditsEvent`, `CostReport`, `GiftRecord`, `GiftTask`, `PricedCredits`, `PricedTrial`, `PricedPlanPrice`, `PricedPlan`, `PricedPlanGift`, `PricedGiftLength`, `PricedPack`, `PricedOffer`, `PricedPromotion`, `Pricing`, `QuotaUsage`, `BillingWebhookEventHandlers`, `SaveOfferTerms`, `BillingComponents`, `BillingEmail`, `BillingEntity`, `BillingAccessRule`, `BillingEntityCtx`, `EntityProfile`, `SetupBillingConfig`, `CommerceConfig`, `AccountBillingErasure`, `AccountBillingErasureInput`, `AccountBillingExport`, `AccountBillingRecord`, `Billing`, `BillingAudit`, `BillingLifecycle`, `CancelFlowState`, `CancelOutcome`, `BillingConsole`, `SaveOffer`, `SaveOfferRule`, `WithdrawalPeriod`, `MeterUsage`, `RevenueCancellations`, `RevenueInterval`, `RevenueMetric`, `RevenueOptions`, `RevenuePeriod`, `RevenueReport`, `RevenueValues`, `BillingCatalog`, `CatalogCreditGrant`, `CatalogCurrencyPrices`, `CatalogDiscount`, `CatalogDiscountDuration`, `CatalogDiscountProducts`, `CatalogDiscountTerms`, `CatalogFeature`, `CatalogInterval`, `CatalogMeter`, `CatalogPack`, `CatalogPackPrices`, `CatalogPlan`, `CatalogPlanCreditGrant`, `CatalogPlanGift`, `CatalogPlanPrices`, `CatalogQuota`, `MeterUnit`, `BillingProviderName`, `ChangePlanRequest`, `CheckoutCustomer`, `CheckoutRequest`, `CheckoutSession`, `CommerceProvider`, `DigitalContentConsent`, `InvoiceAnswer`, `NeutralBillingEvent`, `NeutralOrder`, `NeutralRefund`, `NeutralSubscription`, `NeutralSubscriptionStatus`, `ProviderCapabilities`, `ProviderEnvironment`, `ProviderOptions`, `RefundRequest`, `VerifiedDelivery`, `CommerceEventHandler`, `CommerceWebhookOptions`, `BillingLaunch`, `BillingLaunchReason`, `ClaimRefusal`, `DueReferral`, `ReferralCodeView`, `ReferralComponents`, `ReferralRefs`, `ReferralConsole`, `ReferralConsoleRow`, `ReferralConsoleRows`, `ReferralEntry`, `ReferralPreview`, `ReferralProgram`, `Referrals`, `ReferralsApi`, `ReferralsView`, `ReferredOffer`, `ReferrerOffer`, `SetupReferralsOptions`, `StoredTerms`, `ReferralCaps`, `ReferralRewards`, `ReferralState`, `ReferralTerms`, `ReferredReward`, `ReferrerReward`.
|
|
50
63
|
|
|
51
64
|
## CLI
|
|
52
65
|
|
|
@@ -75,6 +75,7 @@ production keeps where it hides a plain `Error` as "Server Error".
|
|
|
75
75
|
- [Render data on the server](https://nuxt-backend.dev/docs/build/data/read-write/server-rendering): Render pages with their data, signed-in reads included, and go live in the browser without a second fetch; preload from a Nitro route, or call the backend from your own API routes.
|
|
76
76
|
- [Handle errors](https://nuxt-backend.dev/docs/build/data/read-write/errors): Read a refusal's code with getBackendError, show the right sentence or the way out, and refuse from your own functions with the same codes. Reach for `nuxt-backend/functions`.
|
|
77
77
|
- [Search your data](https://nuxt-backend.dev/docs/build/data/read-write/search): Find rows by the words in a text field: a search builder checked against your schema, a ready-made search query, and useSearch to drive it from an input. Reach for `nuxt-backend/search`.
|
|
78
|
+
- [Show who is here](https://nuxt-backend.dev/docs/build/data/read-write/presence): Keep the signed-in person in a room while a page is open, and list who else is there, live: Convex's presence component behind the backend's sign-in, and useRoomPresence. Reach for `nuxt-backend/presence`.
|
|
78
79
|
- [Query and update data](https://nuxt-backend.dev/docs/build/data/read-write): Read live data in Vue with useQuery, write with useMutation and optimistic updates, call actions, load long lists a page at a time, and ride out a dropped connection.
|
|
79
80
|
- [Accept checked uploads](https://nuxt-backend.dev/docs/build/data/files/checked-uploads): Accept photos and files checked on the server: size and sniffed type, EXIF and GPS stripped, quotas counted in files and bytes, and the file stored with its row in one mutation, or claimed after an upload URL.
|
|
80
81
|
- [Show images](https://nuxt-backend.dev/docs/build/data/files/images): Show a stored image with `<StorageImage>`, at the size and format a page needs with `<NuxtImg>` and the backend image provider, or behind an expiring private URL that stops working after a set time.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# nuxt-backend-data: the API
|
|
4
4
|
|
|
5
|
-
The public names of the function tiers, queries and mutations, errors, search, workflows, uploads, share links, retention, tokens and the Convex components for counts, queues, cached actions, crons and migrations, each with the first sentence of its doc comment.
|
|
5
|
+
The public names of the function tiers, queries and mutations, errors, search, workflows, uploads, share links, presence, retention, tokens and the Convex components for counts, queues, cached actions, crons and migrations, each with the first sentence of its doc comment.
|
|
6
6
|
|
|
7
7
|
The file ships inside the package, so it describes exactly the version in `node_modules`. The
|
|
8
8
|
core skill, `nuxt-backend`, lists every public name in its own `references/api.md`.
|
|
@@ -16,6 +16,7 @@ core skill, `nuxt-backend`, lists every public name in its own `references/api.m
|
|
|
16
16
|
| `useConnectionState()` | The base module's, from `nuxt-convex-module/client`, under a neutral name. |
|
|
17
17
|
| `useSearch()` | Reactive, debounced full-text search. |
|
|
18
18
|
| `useWorkflowStatus()` | Reactively track a durable Workflow's status. |
|
|
19
|
+
| `useRoomPresence()` | Who is here: keep the signed-in person in a room (a page, a document, `workspace:<id>`) while the page is open and visible, and list who else is there, live. |
|
|
19
20
|
| `useShareLink()` | One row's share link: whether it has a live one and since when, read live, and the actions that turn it on (or mint a new one) and off, through `getShareLink`, `enableShareLink` and `revokeShareLink` of `backend/storage.ts`. |
|
|
20
21
|
| `useUploadField()` | The upload field without its markup: pick a file (by the button or by dropping it), run your `prepare` on it, upload it with the base module's `useUploadQueue` through the upload URL `setupStorage` mints, then hand the storage id to your `claim`, where the deployment checks it. |
|
|
21
22
|
| `preparePhoto()` | Make one photo ready to send, in the browser: decoded (a HEIC through `heic-to` when this browser can't open it, loaded only then), turned upright by its EXIF orientation, scaled down to `longEdge`, and re-encoded as `type` (JPEG by default) on a canvas, which keeps the pixels and drops every metadata tag, GPS included. |
|
|
@@ -81,3 +82,11 @@ Types: `WorkflowId`, `WorkflowStatus`, `WorkflowComponents`, `EmailSequenceStep`
|
|
|
81
82
|
| `stripImageMetadata()` | An image's bytes without its EXIF, XMP, IPTC and GPS data, its container rewritten and its pixels untouched, so quality is unchanged: JPEG, PNG and WebP. |
|
|
82
83
|
|
|
83
84
|
Types: `FileOwner`, `StoredFile`, `ResolvedShareLink`, `ShareLinkState`, `MintedShareLink`, `StorageApi`, `StorageReadCtx`, `StorageWriteCtx`, `ShareCtx`, `ShareMutationCtx`, `EnabledShareLink`, `ShareableOptions`, `UploadSafety`, `AcceptUploadOptions`, `StorageQuota`, `SetupStorageOptions`, `Storage`, `StorageComponents`.
|
|
85
|
+
|
|
86
|
+
### `nuxt-backend/presence`
|
|
87
|
+
|
|
88
|
+
| Export | What it is |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `setupPresence()` | Who is here, for a page, a document or a workspace: Convex's presence component (`@convex-dev/presence`, mounted as `presence` in `convex.config.ts`) behind the backend's sign-in. |
|
|
91
|
+
|
|
92
|
+
Types: `PresenceComponents`, `PresenceRoomCheck`, `SetupPresenceOptions`, `RoomMember`, `PresenceSetup`.
|
|
@@ -47,7 +47,7 @@ core skill, `nuxt-backend`, lists every public name in its own `references/api.m
|
|
|
47
47
|
| `linkBlocks()` | The blocks of an email's one link: a button, then the link written out for a mail app that shows no button (the `email.link.fallback` label). |
|
|
48
48
|
| `plainName()` | A name someone typed as an email shows it: every link and bare domain taken out, whitespace collapsed, at most `max` characters; `undefined` when nothing is left. |
|
|
49
49
|
|
|
50
|
-
Types: `EmailBlock`, `DeletionCanceledEmailData`, `DeletionScheduledEmailData`, `EmailBrand`, `EmailChangedEmailData`, `EmailColors`, `EmailFonts`, `EmailLocalePaths`, `EmailMessage`, `EmailMessages`, `EmailPreview`, `EmailRenderContext`, `EmailScheme`, `EmailTemplateData`, `EmailTemplateName`, `EmailTemplateOverrides`, `EmailTemplates`, `EmailTheme`, `GiftEmailData`, `GiftPassEndingEmailData`, `RenewalReminderEmailData`, `WithdrawalReceiptEmailData`, `InviteEmailData`, `OtpEmailData`, `OtpPurpose`, `ResolvedEmailTheme`, `PasskeyRecoveredEmailData`, `NewDeviceEmailData`, `RequestOrigin`, `TopicConfirmationEmailData`, `TrustedHtml`, `WaitlistAdmittedEmailData`, `WaitlistConfirmationEmailData`, `WelcomeEmailData`, `NoticeReceivedEmailData`, `NoticeDecidedEmailData`, `ContentRestrictedEmailData`, `AppealDecidedEmailData`, `NotificationEmailData`, `AppLabels`, `AppNotificationLabels`, `LabelParams`, `Translate`, `ClockTime`, `EmailCaps`, `EmailTopic`, `EmailTopics`, `TopicSource`, `TopicState`, `EmailLinkView`, `EmailPreferencesApi`, `EmailTopicPreference`, `EmailContactProperty`, `EmailSyncAction`, `EmailSyncLogEntry`, `EmailSyncReport`, `EmailAutomations`, `EmailLifecycle`, `EmailRunCtx`, `LifecycleFlow`, `LifecycleFlowOptions`, `LifecycleKind`, `Suppression`, `SuppressionOrigin`, `SuppressionsApi`, `SuppressionsPage`, `AnnouncementAudience`, `AnnouncementBroadcastState`, `AnnouncementRow`, `AnnouncementsApi`, `AnnouncementsConsole`, `LiveAnnouncement`, `PublishAnnouncementInput`, `ContactOptions`, `InboundMessage`, `InboundOptions`, `InboundRateLimiter`, `InboundSyncReport`, `InboxConsole`, `InboxRow`, `EmailComponents`, `SandboxMessage`, `EmailStatus`, `EmailRecord`, `SendEmailOptions`, `EmailWebhookEventType`, `EmailEventData`, `InboxEmailEventData`, `ContactEventData`, `ContactTopicsEventData`, `SuppressionEventData`, `TopicEventData`, `DomainEventData`, `EmailWebhookEvent`, `EmailWebhookEventHandlers`, `EmailRetention`, `SetupEmailOptions`, `Email`.
|
|
50
|
+
Types: `EmailBlock`, `DeletionCanceledEmailData`, `DeletionScheduledEmailData`, `EmailBrand`, `EmailChangedEmailData`, `EmailColors`, `EmailFonts`, `EmailLocalePaths`, `EmailMessage`, `EmailMessages`, `EmailPreview`, `EmailRenderContext`, `EmailScheme`, `EmailTemplateData`, `EmailTemplateName`, `EmailTemplateOverrides`, `EmailTemplates`, `EmailTheme`, `GiftEmailData`, `GiftPassEndingEmailData`, `RenewalReminderEmailData`, `WithdrawalReceiptEmailData`, `InviteEmailData`, `OtpEmailData`, `OtpPurpose`, `ResolvedEmailTheme`, `PasskeyRecoveredEmailData`, `NewDeviceEmailData`, `RequestOrigin`, `TopicConfirmationEmailData`, `TrustedHtml`, `WaitlistAdmittedEmailData`, `WaitlistConfirmationEmailData`, `WaitlistFriendJoinedEmailData`, `WelcomeEmailData`, `NoticeReceivedEmailData`, `NoticeDecidedEmailData`, `ContentRestrictedEmailData`, `AppealDecidedEmailData`, `NotificationEmailData`, `AppLabels`, `AppNotificationLabels`, `LabelParams`, `Translate`, `ClockTime`, `EmailCaps`, `EmailTopic`, `EmailTopics`, `TopicSource`, `TopicState`, `EmailLinkView`, `EmailPreferencesApi`, `EmailTopicPreference`, `EmailContactProperty`, `EmailSyncAction`, `EmailSyncLogEntry`, `EmailSyncReport`, `EmailAutomations`, `EmailLifecycle`, `EmailRunCtx`, `LifecycleFlow`, `LifecycleFlowOptions`, `LifecycleKind`, `Suppression`, `SuppressionOrigin`, `SuppressionsApi`, `SuppressionsPage`, `AnnouncementAudience`, `AnnouncementBroadcastState`, `AnnouncementRow`, `AnnouncementsApi`, `AnnouncementsConsole`, `LiveAnnouncement`, `PublishAnnouncementInput`, `ContactOptions`, `InboundMessage`, `InboundOptions`, `InboundRateLimiter`, `InboundSyncReport`, `InboxConsole`, `InboxRow`, `EmailComponents`, `SandboxMessage`, `EmailStatus`, `EmailRecord`, `SendEmailOptions`, `EmailWebhookEventType`, `EmailEventData`, `InboxEmailEventData`, `ContactEventData`, `ContactTopicsEventData`, `SuppressionEventData`, `TopicEventData`, `DomainEventData`, `EmailWebhookEvent`, `EmailWebhookEventHandlers`, `EmailRetention`, `SetupEmailOptions`, `Email`.
|
|
51
51
|
|
|
52
52
|
### `nuxt-backend/notifications`
|
|
53
53
|
|
|
@@ -132,6 +132,7 @@ unless the user asks. Overrides, rollouts, key rules and the audit trail are in
|
|
|
132
132
|
- [Vercel](https://nuxt-backend.dev/docs/services/vercel): Set up Vercel to host the Nuxt app: the account, the project, its environments, preview deployments, the function region and the env it needs from the backend.
|
|
133
133
|
- [Sentry](https://nuxt-backend.dev/docs/services/sentry): Set up Sentry for errors, logs, replays, feedback, alerts and uptime: the account and its data region, the project, the DSN for the app and the deployment, source maps, cron monitors, the alert rules and the health monitor.
|
|
134
134
|
- [Bot protection](https://nuxt-backend.dev/docs/services/bot-protection): Set up the bot check that guards sign-in and sign-up: Vercel BotID on Vercel, or a Cloudflare Turnstile challenge on any other host, with its keys.
|
|
135
|
+
- [Stripe, Dodo and Creem](https://nuxt-backend.dev/docs/services/merchants): Sell through Stripe Managed Payments, Dodo Payments or Creem instead of Polar: what each merchant of record offers, the keys, the product ids setupBilling maps, how credits work, the webhook, what stays on Polar, and the account review. Reach for `billingProviderName()` from `nuxt-backend/billing`, `commerceProviderFromEnv()` from `nuxt-backend/billing`.
|
|
135
136
|
|
|
136
137
|
**Develop**
|
|
137
138
|
|
|
@@ -162,7 +163,7 @@ unless the user asks. Overrides, rollouts, key rules and the audit trail are in
|
|
|
162
163
|
- [Follow the CSAM playbook](https://nuxt-backend.dev/docs/ship/compliance/moderation/csam-playbook): What to do when an upload matches a list of known child sexual abuse material: keep the image from everyone, keep the evidence, report it to the authorities, and never tell the uploader. Not legal advice.
|
|
163
164
|
- [Moderate user content](https://nuxt-backend.dev/docs/ship/compliance/moderation): What the DSA and the TAKE IT DOWN Act ask of an app that hosts what people upload: a notice form anyone can use, statements of reasons, an appeal, reports of crimes and the 48-hour removal. Not legal advice.
|
|
164
165
|
- [Follow email law](https://nuxt-backend.dev/docs/ship/compliance/email-law): Consent, one-click unsubscribe, sender identity and a postal address under the mailbox providers' sender rules, CAN-SPAM, GDPR and ePrivacy, and which parts the package handles. Not legal advice.
|
|
165
|
-
- [Follow subscription law](https://nuxt-backend.dev/docs/ship/compliance/subscriptions): The EU withdrawal right and button, renewal consent and reminders, online cancellation and refunds, and which of them the merchant of record handles for you. Not legal advice.
|
|
166
|
+
- [Follow subscription law](https://nuxt-backend.dev/docs/ship/compliance/subscriptions): The EU withdrawal right and button, the consent that ends it for digital content, renewal consent and reminders, online cancellation and refunds, and which of them the merchant of record handles for you. Not legal advice.
|
|
166
167
|
- [Set a minimum age](https://nuxt-backend.dev/docs/ship/compliance/age): Choose the minimum age your app accepts, ask for it at sign-up and refuse anyone younger, and what COPPA and GDPR Art. 8 ask when children could sign up. Not legal advice.
|
|
167
168
|
- [Monitor errors and uptime](https://nuxt-backend.dev/docs/ship/operate/monitoring): Report errors from the browser, the Nuxt server and the backend's actions with personal data scrubbed, send log lines, replay sessions after consent, take feedback, check crons in, raise alerts on the email quota, AI spend and Convex usage, and see what AI costs per person. Sentry once a DSN is set; a local error log in dev. Reach for `nuxt-backend/monitoring`.
|
|
168
169
|
- [Roll out features and pause services](https://nuxt-backend.dev/docs/ship/operate/flags): Declare feature flags in code and read them inside queries and mutations, target them by account, workspace, plan or a stable percentage, and pull the kill switches: pause sign-ups, checkout or AI, or put up a maintenance notice. Reach for `nuxt-backend/flags`.
|
|
@@ -17,6 +17,12 @@ has the reasons and every step. The core skill's `references/renames.json`, in
|
|
|
17
17
|
After it, run `npx nuxt-backend doctor`, and `npx nuxt-backend init --agents` to refresh the app's
|
|
18
18
|
agent files and skills.
|
|
19
19
|
|
|
20
|
+
## [The module requires Nuxt 4.7.0](https://nuxt-backend.dev/docs/ship/releases/upgrade#the-module-requires-nuxt-470)
|
|
21
|
+
|
|
22
|
+
| Was | Now | Change | Note |
|
|
23
|
+
|---|---|---|---|
|
|
24
|
+
| `^4.6.2` | `^4.7.0` | reshaped | the module's Nuxt compatibility: Nuxt 4.6 no longer builds with Vite 8.4, so move the app to Nuxt 4.7.0 or later |
|
|
25
|
+
|
|
20
26
|
## [A composable falls back when the app lacks its backend file](https://nuxt-backend.dev/docs/ship/releases/upgrade#a-composable-falls-back-when-the-app-lacks-its-backend-file)
|
|
21
27
|
|
|
22
28
|
| Was | Now | Change | Note |
|
|
@@ -182,9 +182,11 @@ export interface WaitlistRecord {
|
|
|
182
182
|
id: string
|
|
183
183
|
/** `true` the first time the address's code checked: the entry was made now. */
|
|
184
184
|
created: boolean
|
|
185
|
-
/**
|
|
185
|
+
/** Whether it still waits: only a waiting entry learns its place. */
|
|
186
|
+
waiting: boolean
|
|
187
|
+
/** The place among the people waiting, 1-based; `null` when the entry is not waiting, or the waitlist keeps rank private. */
|
|
186
188
|
position: number | null
|
|
187
|
-
/** How many people wait. */
|
|
189
|
+
/** How many people wait; 0 when rank is private. */
|
|
188
190
|
total: number
|
|
189
191
|
/** The signed token of the status link, `/waitlist#<token>`. */
|
|
190
192
|
token: string
|
|
@@ -192,6 +194,12 @@ export interface WaitlistRecord {
|
|
|
192
194
|
source: string
|
|
193
195
|
referred: boolean
|
|
194
196
|
news: boolean
|
|
197
|
+
/**
|
|
198
|
+
* The friend whose link the new entry came through, while they wait:
|
|
199
|
+
* where they stand now (the `waitlist.friend_joined` event), and whom to
|
|
200
|
+
* email when the waitlist tells sharers (`notify`, from `boost.notify`).
|
|
201
|
+
*/
|
|
202
|
+
sharer?: { email: string, locale: string | null, friends: number, credit: number, token: string, notify: boolean }
|
|
195
203
|
}
|
|
196
204
|
|
|
197
205
|
/**
|
|
@@ -65,8 +65,8 @@ export const ACCOUNT_DATA_SOURCES = {
|
|
|
65
65
|
auth: {
|
|
66
66
|
capability: 'auth',
|
|
67
67
|
where: 'component',
|
|
68
|
-
tables: ['user', 'session', 'account', 'passkey', 'verification'],
|
|
69
|
-
holds: 'The account: name, address, language, app role and ban, and whether it finished the first run and dismissed the activation checklist; its sessions with their browser and network address; its passkeys; the sign-in and email-change codes waiting for its address, stored as keyed hashes.',
|
|
68
|
+
tables: ['user', 'session', 'account', 'passkey', 'twoFactor', 'verification'],
|
|
69
|
+
holds: 'The account: name, address, language, app role and ban, and whether it finished the first run and dismissed the activation checklist; its sessions with their browser and network address; its passkeys; its authenticator app\'s secret and backup codes, encrypted under the auth secret; the sign-in and email-change codes waiting for its address, stored as keyed hashes.',
|
|
70
70
|
keyedBy: ['account', 'email'],
|
|
71
71
|
erasure: 'deleted',
|
|
72
72
|
erasureNote: 'The account and everything of its sign-in are removed, codes waiting for its address included.',
|
|
@@ -120,8 +120,8 @@ export const ACCOUNT_DATA_SOURCES = {
|
|
|
120
120
|
billing: {
|
|
121
121
|
capability: 'billing',
|
|
122
122
|
where: 'component',
|
|
123
|
-
tables: ['billingEntitlements', 'billingSubscriptionChanges', 'billingDiscountAttempts', 'billingQuotaKeys', 'billingTrials', 'billingDeletions', 'billingSaveOffers'],
|
|
124
|
-
holds: 'The cached plans, features and credit balances of the account\'s billing entities, their scheduled plan changes and quota keys, the save offers the cancel flow made them, and the trial the account used.',
|
|
123
|
+
tables: ['billingEntitlements', 'billingSubscriptionChanges', 'billingDiscountAttempts', 'billingQuotaKeys', 'billingTrials', 'billingDeletions', 'billingSaveOffers', 'billingCommerceCustomers', 'billingCommerceOrders', 'billingCreditGrants'],
|
|
124
|
+
holds: 'The cached plans, features and credit balances of the account\'s billing entities, their scheduled plan changes and quota keys, the save offers the cancel flow made them, and the trial the account used. On Stripe, Dodo or Creem also their customer ids at the provider, their paid orders (amounts, tax, currency and refunds, never a card) and the credit grants those orders made.',
|
|
125
125
|
keyedBy: ['account', 'entity'],
|
|
126
126
|
erasure: 'deleted',
|
|
127
127
|
erasureNote: 'The cache of every billing entity deleted with the account is removed, and so is the record of its trial. Each entity is marked as deleting first, so no free plan starts for it again.',
|
|
@@ -510,6 +510,7 @@ export const NO_PERSONAL_DATA: Readonly<Record<string, string>> = {
|
|
|
510
510
|
monitoringAlerts: 'Which alert fired for which day or month.',
|
|
511
511
|
billingGiftSweep: 'The handle the gift sweep wakes the app by.',
|
|
512
512
|
referralSweep: 'The handle the referral sweep wakes the app by.',
|
|
513
|
+
billingCommerceReversals: 'A refund or a dispute held for an order not recorded yet: the provider\'s order and refund ids and an amount, naming no one until the order lands.',
|
|
513
514
|
billingLifecycleMarks: 'What the billing lifecycle did once and when, by subscription or checkout id: an annual reminder, an abandoned checkout\'s hand-off.',
|
|
514
515
|
quotaCounters: 'The quota keys storage counts files and bytes under, the same for every account.',
|
|
515
516
|
urlClock: 'When the signed URL clock last ticked: one time for the whole app.',
|
package/src/convex/app.ts
CHANGED
|
@@ -102,7 +102,8 @@ export const backendEnv = {
|
|
|
102
102
|
EMAIL_WEBHOOK_SECRET: v.optional(v.string()),
|
|
103
103
|
// The dev inbox's page reader, opted into with `1` outside production; read by the app's own getSandboxInbox, never forwarded.
|
|
104
104
|
EMAIL_DEV_INBOX: v.optional(v.string()),
|
|
105
|
-
// Billing — optional.
|
|
105
|
+
// Billing — optional. The merchant of record: polar when unset.
|
|
106
|
+
BILLING_PROVIDER: v.optional(v.union(v.literal('polar'), v.literal('stripe'), v.literal('dodo'), v.literal('creem'))),
|
|
106
107
|
BILLING_ACCESS_TOKEN: v.optional(v.string()),
|
|
107
108
|
BILLING_WEBHOOK_SECRET: v.optional(v.string()),
|
|
108
109
|
// AI — optional; the gateway's own name, never renamed.
|
|
@@ -21,6 +21,7 @@ import { authRefusal } from './refusals.js'
|
|
|
21
21
|
import { pausedData } from '../pauses.js'
|
|
22
22
|
import { type DatabaseHooks, mergeDatabaseHooks } from './hooks.js'
|
|
23
23
|
import { ACCOUNT_FIELDS, administratorsOf, defaultAdmin, type DefaultAuthPlugin, defaultLastLoginMethod, defaultPasskey, SESSION_FIELDS, sessionSignInMethod } from './plugins.js'
|
|
24
|
+
import { defaultTwoFactor, twoFactorAfterCode } from './two-factor.js'
|
|
24
25
|
import { isAdministrator } from '../integrations/access.js'
|
|
25
26
|
import { CLIENT_IP_HEADER, protectionEnv } from '../proof.js'
|
|
26
27
|
import { resolveBackendPaths } from '../paths.js'
|
|
@@ -65,8 +66,9 @@ export function sessionClaims({ user, session }: { user: Record<string, unknown>
|
|
|
65
66
|
// plugin swallows it and sets no cookie.
|
|
66
67
|
if (session.passkeyRecovery) throw authRefusal('forbidden', { reason: 'passkey_required' })
|
|
67
68
|
// How the account last signed in is the sign-in form's, not a caller's:
|
|
68
|
-
// it changes with every sign-in and says nothing a function needs.
|
|
69
|
-
|
|
69
|
+
// it changes with every sign-in and says nothing a function needs. So is
|
|
70
|
+
// whether it has an authenticator app, which the security page reads.
|
|
71
|
+
const { id: _id, image: _image, lastLoginMethod: _lastLoginMethod, twoFactorEnabled: _twoFactor, onboardedAt: _onboardedAt, activationDismissedAt: _dismissedAt, ...fields } = user
|
|
70
72
|
const claims = Object.fromEntries(Object.entries(fields).filter(([key]) => !RESERVED_CLAIMS.includes(key)))
|
|
71
73
|
// The package's own `locale` field is the standard claim of that name,
|
|
72
74
|
// as a language tag only: no other value reaches it.
|
|
@@ -91,7 +93,9 @@ export function sessionClaims({ user, session }: { user: Record<string, unknown>
|
|
|
91
93
|
* none). `undefined` when it adds neither.
|
|
92
94
|
*/
|
|
93
95
|
function openedSession(session: Record<string, unknown>, activeOrganizationId: string | undefined, hookCtx: unknown): { data: Record<string, unknown> } | undefined {
|
|
94
|
-
|
|
96
|
+
// A session that replaces another keeps its method (the authenticator app's turning on copies the old one's fields).
|
|
97
|
+
const kept = typeof session.signInMethod === 'string' ? session.signInMethod : null
|
|
98
|
+
const signInMethod = session.impersonatedBy ? null : kept ?? sessionSignInMethod((hookCtx as { path?: string } | null)?.path)
|
|
95
99
|
if (!activeOrganizationId && !signInMethod) return undefined
|
|
96
100
|
return { data: { ...session, ...(activeOrganizationId ? { activeOrganizationId } : {}), ...(signInMethod ? { signInMethod } : {}) } }
|
|
97
101
|
}
|
|
@@ -190,6 +194,8 @@ export function buildAuthOptions<DM extends GenericDataModel = GenericDataModel>
|
|
|
190
194
|
// takes a proof.
|
|
191
195
|
const protection = protectionEnv()
|
|
192
196
|
const challenge = protection.challengeSecretKey && !userPluginIds.has('captcha') ? challengePlugin(protection.challengeSecretKey, protection.proofSecret) : undefined
|
|
197
|
+
// The authenticator app's second step runs after a code on the two-factor plugin in use: the package's, or an app's own.
|
|
198
|
+
const twoFactorPlugin = (userPlugins.find(plugin => plugin.id === 'two-factor') ?? defaultTwoFactor()) as ReturnType<typeof defaultTwoFactor>
|
|
193
199
|
const defaultPlugins = [
|
|
194
200
|
emailOTP({
|
|
195
201
|
sendVerificationOTP: makeSendVerificationOTP(runtime),
|
|
@@ -215,6 +221,9 @@ export function buildAuthOptions<DM extends GenericDataModel = GenericDataModel>
|
|
|
215
221
|
// Passkey-only accounts: the switch, the recovery code and its session.
|
|
216
222
|
passkeyOnlyPlugin({ administrators, runtime }) as DefaultAuthPlugin,
|
|
217
223
|
organization(organizationOptions(options.workspaces, runtime, sendInvitationEmail)),
|
|
224
|
+
// An authenticator app as a second factor after a sign-in code, for an account that turns it on.
|
|
225
|
+
twoFactorPlugin as DefaultAuthPlugin,
|
|
226
|
+
twoFactorAfterCode(twoFactorPlugin) as DefaultAuthPlugin,
|
|
218
227
|
...(challenge ? [challenge as DefaultAuthPlugin] : []),
|
|
219
228
|
// Sessions signed before an AUTH_SECRET rotation keep working until the previous secret retires.
|
|
220
229
|
secretRotationPlugin(),
|
|
@@ -27,6 +27,8 @@ const SIGN_IN_PATH = '/sign-in/email-otp'
|
|
|
27
27
|
const ADMIN_CREATE_PATH = '/admin/create-user'
|
|
28
28
|
/** The emailOTP plugin's attempt limit, as the package sets it. */
|
|
29
29
|
const ALLOWED_ATTEMPTS = 3
|
|
30
|
+
/** A day, for the one "a friend joined" email a day a sharer gets. */
|
|
31
|
+
const DAY_MS = 24 * 60 * 60 * 1000
|
|
30
32
|
|
|
31
33
|
/** The body field an invite code or an access link's token rides in, on the code check. */
|
|
32
34
|
export const INVITE_FIELD = 'inviteCode'
|
|
@@ -62,10 +64,33 @@ function ticketRequired(phase: AccessPhase, invite: string | null, waitlist?: Wa
|
|
|
62
64
|
reason: 'ticket_required',
|
|
63
65
|
phase,
|
|
64
66
|
...(invite ? { invite } : {}),
|
|
65
|
-
|
|
67
|
+
// The place only where the waitlist shows rank; the status link always, while the entry waits.
|
|
68
|
+
...(waitlist?.waiting ? { waitlist: { token: waitlist.token, ...(waitlist.position ? { position: waitlist.position, total: waitlist.total } : {}) } } : {}),
|
|
66
69
|
})
|
|
67
70
|
}
|
|
68
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Tell the friend whose link a new entry came through that it worked: one
|
|
74
|
+
* email a day at most, whoever else joins that day. It cannot fail the code
|
|
75
|
+
* check.
|
|
76
|
+
*/
|
|
77
|
+
async function tellSharer<DM extends GenericDataModel>(runtime: AuthRuntime<DM> | undefined, ctx: AuthMutationCtx, sharer: NonNullable<WaitlistRecord['sharer']>, site: string | undefined): Promise<void> {
|
|
78
|
+
try {
|
|
79
|
+
if (!runtime?.email || !site) throw new Error(site ? 'no email instance is wired into setupAuth' : 'SITE_URL is not set')
|
|
80
|
+
const day = Math.floor(Date.now() / DAY_MS)
|
|
81
|
+
const entry = sharer.token.slice(0, sharer.token.indexOf('.'))
|
|
82
|
+
await runtime.email.sendTemplate(ctx, 'waitlistFriendJoined', {
|
|
83
|
+
email: sharer.email,
|
|
84
|
+
statusUrl: `${site}${runtime?.paths?.waitlist ?? DEFAULT_WAITLIST_PATH}#${sharer.token}`,
|
|
85
|
+
friends: sharer.friends,
|
|
86
|
+
days: Math.floor(sharer.credit / DAY_MS),
|
|
87
|
+
}, { ...(sharer.locale ? { fallbackLocale: sharer.locale } : {}), idempotencyKey: `nuxt-backend:waitlist-friend:${entry}:${day}` })
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
logBackend('warn', 'waitlist.friend_unsent', 'A friend joined through a waitlist link, but the sharer was not emailed; the credit stands.', error)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
69
94
|
/**
|
|
70
95
|
* A new address's code checked in early access: its waitlist entry is
|
|
71
96
|
* recorded (once), the join lands on the activity trail, and the first time
|
|
@@ -79,11 +104,13 @@ async function recordWaitlistEntry<DM extends GenericDataModel>(runtime: AuthRun
|
|
|
79
104
|
if (!entry.created) return entry
|
|
80
105
|
try {
|
|
81
106
|
await runtime?.audit?.recordBackendEvent(ctx as never, { type: 'waitlist.joined', actor: null, data: { source: entry.source, referred: entry.referred, news: entry.news } })
|
|
107
|
+
if (entry.sharer) await runtime?.audit?.recordBackendEvent(ctx as never, { type: 'waitlist.friend_joined', actor: null, data: { friends: entry.sharer.friends } })
|
|
82
108
|
}
|
|
83
109
|
catch (error) {
|
|
84
110
|
logBackend('warn', 'waitlist.confirmation_unsent', 'A new waitlist entry was recorded, but its join event did not reach the activity trail; the entry stands.', error)
|
|
85
111
|
}
|
|
86
112
|
const site = readEnv('SITE_URL')?.replace(/\/+$/, '')
|
|
113
|
+
if (entry.sharer?.notify) await tellSharer(runtime, ctx, entry.sharer, site)
|
|
87
114
|
try {
|
|
88
115
|
if (!runtime?.email || !site) throw new Error(site ? 'no email instance is wired into setupAuth' : 'SITE_URL is not set')
|
|
89
116
|
await runtime.email.sendTemplate(ctx, 'waitlistConfirmation', {
|
|
@@ -64,6 +64,9 @@ const SESSION_SIGN_IN_ROUTES: Readonly<Record<string, SignInMethod>> = {
|
|
|
64
64
|
'/sign-in/email-otp': 'email-otp',
|
|
65
65
|
'/email-otp/verify-email': 'email-otp',
|
|
66
66
|
'/passkey/verify-authentication': 'passkey',
|
|
67
|
+
// The authenticator app's step after a code: the session the code began.
|
|
68
|
+
'/two-factor/verify-totp': 'email-otp',
|
|
69
|
+
'/two-factor/verify-backup-code': 'email-otp',
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
/**
|