--- ## PushPermissionPrompt A dismissible prompt that asks the user to enable push notifications, then registers the VAPID subscription with the server. **Import:** `import { PushPermissionPrompt } from '@urbicon-ui/auth';` ### Examples ```svelte console.log('Subscribed', sub)} /> ``` ### Api | Prop | Type | Required | Default | Description | | --- | --- | :---: | --- | --- | | vapidPublicKey | `string` | yes | | VAPID public key for push subscription. | | apiPath | `string` | no | '/api/notifications/push-subscription' | API endpoint for registering subscriptions. | | class | `string` | no | | Extra classes on the root element. In the same Tailwind bucket `class` wins over the `slotClasses` entry for the element it lands on. Presets and provider defaults sit below both. | | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names. Only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. | | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. | | onDismissed | `() => void` | no | | Called when the user dismisses the prompt. | | onSubscribed | `(subscription: PushSubscription) => void` | no | | Called after successful push subscription. | | onUnavailable | `(reason: 'denied' | 'unsupported') => void` | no | | Called when the prompt closes because push is not available: the user declined the browser permission (`'denied'`) or the browser has no push support (`'unsupported'`). Persist this to avoid remounting the prompt on every visit; without it, a denial is indistinguishable from never having shown the prompt. Operational failures do not close the prompt; they show the error state instead. | | preset | `string` | no | | Apply a named preset registered via ``. Resolves after the provider defaults and before this instance's own `slotClasses`, so a project-wide look lives in one place instead of being repeated at every usage site. | | slotClasses | `Partial>` | no | | Per-slot class overrides. `error` styles the error Alert itself — present only while an error is shown — not the live region that always surrounds it (the same contract as every other component's `error` slot). In the same Tailwind bucket `class` wins over the `slotClasses` entry for the element it lands on. Presets and provider defaults sit below both. | | t | `PartialAuthLocale` | no | | Locale overrides, deep-merged over the bundle registered for the active locale — English unless `registerAuthLocale` ran for it. Pass any subset, from a single string to a whole tree. | | unstyled | `boolean` | no | | Strip all default styling. | ### Types ```ts type PartialAuthLocale = DeepPartial ``` ```ts interface CsrfClientOptions { cookieName?: string; headerName?: string; /** * Match the server's `csrf.useHostPrefix` — read the token from the * `__Host-`-prefixed cookie name. Leave `false` (default) unless the server * sets `useHostPrefix: true`. */ useHostPrefix?: boolean; } ``` ```ts type DeepPartial = T extends object ? { [K in keyof T]?: DeepPartial } : T ``` - `interface AuthLocale` — 8 members, definition omitted (387 lines; full definition: packages/auth/src/lib/i18n/keys.ts) ### Slots (slotClasses keys) `root`, `text`, `error`, `actions`