# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.klai.studio/reference/actions-processor/actions_overview/pwapromptpushpermission.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
