# pwaCustomInstall

`pwaCustomInstall` listens for the browser's `beforeinstallprompt` event, prevents the browser from auto-showing the install prompt, and stores the deferred prompt so your app can trigger it later.

## Action Object

| Key                           | Type       | Description                                                              |
| ----------------------------- | ---------- | ------------------------------------------------------------------------ |
| `action`                      | `string`   | Must be `"pwaCustomInstall"`                                             |
| `options.beforeinstallprompt` | `function` | Optional callback to run when the browser fires the install prompt event |

## Example

```json
{
  "action": "pwaCustomInstall",
  "options": {
    "beforeinstallprompt": "callback that updates install UI state"
  }
}
```

## Behavior Notes

* BetterForms prevents the default browser install prompt.
* The deferred prompt is stored on `window.deferredPrompt`.
* This action is usually paired with `pwaPromptInstall`, which triggers the saved prompt later.
* Use this when you want a custom install button or install banner instead of the browser's default timing.

## Related Pages

* [pwaPromptInstall](/reference/actions-processor/actions_overview/pwapromptinstall.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/pwacustominstall.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.
