# SDKイベント

SDK は、すべての重要なイベントに対してイベントを発行します。これらのイベントは、トラッキング、視覚的な変更、またはイベントの後に発生すべきその他の処理などのカスタムロジックを実行するためにリッスンできます。

| イベント                       | 発火トリガー                            |
| -------------------------- | --------------------------------- |
| on\_loaded                 | SDK が訪問者のブラウザに正常に読み込まれました         |
| on\_load\_error            | SDK の読み込みを試みている間に予期しないエラーが発生しました  |
| on\_web\_push\_supported   | 訪問者のウェブブラウザは Web Push をサポートしています  |
| on\_web\_push\_unsupported | 訪問者のウェブブラウザは Web Push をサポートしていません |
| on\_ready                  | SDK は必要な設定をすべて取得し、操作の準備ができています    |
| on\_prompt\_eligible       | 訪問者にはプロンプトを表示できます                 |
| on\_prompt\_ineligible     | 訪問者にプロンプトを表示すべきではありません            |
| on\_prompt\_shown          | プロンプトが訪問者に正常に表示された後               |
| on\_prompt\_dismissed      | 訪問者がプロンプトを閉じた後                    |
| on\_prompt\_allowed        | 訪問者がプロンプトを許可した後                   |
| on\_permission\_shown      | 訪問者にブラウザのネイティブ許可ダイアログが表示された後      |
| on\_permission\_allowed    | 訪問者がブラウザのネイティブ許可ダイアログを許可した後       |
| on\_permission\_denied     | 訪問者がブラウザのネイティブ許可ダイアログを拒否した後       |
| on\_permission\_dismissed  | 訪問者がブラウザのネイティブ許可ダイアログを閉じた後        |

## 例: on\_ready

たとえば、SDK が操作の準備完了になったら独自のカスタムコードを実行するには:

```javascript
pushly('on_ready', function() {
  console.log('example');
});
```


---

# 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://documentation.pushly.com/pushly-ja/integration/webpusshu/sdk/events.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.
