> For the complete documentation index, see [llms.txt](https://docs.klai.studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.klai.studio/reference/actions-processor/actions_overview/pwapromptpushpermission.md).

# pwaPromptPushPermission

`pwaPromptPushPermission` asks the browser for push-notification permission and, when permission is granted, creates or reuses a push subscription and registers it with BetterForms.

## Action Object

| Key       | Type     | Description                                                    |
| --------- | -------- | -------------------------------------------------------------- |
| `action`  | `string` | Must be `"pwaPromptPushPermission"`                            |
| `options` | `object` | Optional metadata sent with the push subscription registration |

## Example

```json
{
  "action": "pwaPromptPushPermission",
  "options": {
    "idUser": "BF_USER_ID"
  }
}
```

## Behavior Notes

* Requires browser support for both `Notification` and `PushManager`.
* BetterForms requests notification permission from the browser.
* If permission is granted, BetterForms retrieves the VAPID public key from the server, subscribes the browser, and saves the subscription using `pushDataRegister`.
* If the browser does not support push notifications, BetterForms alerts the user.

## Related Pages

* [pwaPushNotificationSend](/reference/actions-processor/actions_overview/pwapushnotificationsend.md)
* [Creating a PWA](/reference/apis-and-services/integrations/creating-a-pwa.md)
