> For the complete documentation index, see [llms.txt](https://documentation.pushly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.pushly.com/pushly-ja/integration/webpusshu/kuikkusutto.md).

# クイックスタート

## 要件

Web プッシュ通知のサポートには、次のものが必要です：

* あなたのWebサイトがSSL対応であること（https\://）
* サイト上に配置する、公開アクセス可能なファイル1つ
* サイトの各ページに追加する統合用HTMLスニペット。
  * これはタグマネージャーでも行えます。

## 手順

{% hint style="info" %}
サイトがWordPressを使用している場合、これらの手順はスキップして、 [<mark style="color:青;">WordPressプラグイン</mark>](/pushly-ja/integration/webpusshu/wordpresspuraguin/wordpress-plugin.md) 以下の手順に従うと、より簡単に実装できます。
{% endhint %}

### ステップ1：Service Workerファイルを配置する

Service Worker を次からダウンロード： [<mark style="color:青;">当社のCDN</mark>](https://cdn.p-n.io/pushly-sdk-worker.js) ([<mark style="color:青;">https://cdn.p-n.io/pushly-sdk-worker.js</mark>](https://cdn.p-n.io/pushly-sdk-worker.js)）を、サイトを配信している同じドメイン上の公開アクセス可能な場所に配置します。例： `https://www.example.com/assets/pushly/pushly-sdk-worker.js`

{% hint style="danger" %}
このファイル **必ず** は、潜在的な購読者がサイトを訪れたときにいるのと同じオリジンから配信されなければなりません。別のドメインやサブドメインから配信することはできません。\
\
たとえば、訪問者が `www.example.com` 場合、Service Worker は `www.example.com に配置されていなければなりません。` 次から配信することはできません： `assets.example.com` または `examplecdn.com`.&#x20;

また、それは **できません** 301リダイレクトの背後から配信することもできません。
{% endhint %}

### ステップ2：統合用HTMLを追加する

Service Workerをドメイン内のサブディレクトリに配置した場合は、以下の *Service Worker をサブディレクトリに配置した場合* タブの手順に従ってください。それ以外の場合は *Service Worker を公開ルートに配置した場合* タブを選択してください。

{% tabs %}
{% tab title="Service Worker をサブディレクトリに配置した場合" %}
次のHTMLスニペットをサイトのheadセクションに追加し、 **両方の** 箇所の `SDK_KEY` を、アカウントマネージャーから提供された値に置き換えてください。

また、 `/absolute/path/to/pushly-sdk-worker.js` スニペット内のテキストを、Service Worker への完全なパスに置き換えてください。

```javascript
<script src="https://cdn.p-n.io/sdk/web/latest/pushly-sdk.min.js?domain_key=SDK_KEY" async></script>
<script>
  window.PushlySDK = window.PushlySDK || [];
  function pushly() { window.PushlySDK.push(arguments) }
  pushly('load', {
    domainKey: 'SDK_KEY',
    sw: '/absolute/path/to/pushly-sdk-worker.js',
  });
</script>
```

{% hint style="danger" %}
この `sw` プロパティにはオリジン/ドメインを含めないでください。パスのみを指定してください。つまり、 `https:///www.example.com` この値には含めないでください。
{% endhint %}
{% endtab %}

{% tab title="Service Worker を公開ルートに配置した場合" %}
次のHTMLスニペットをサイトのheadセクションに追加し、 **両方の** 箇所の `SDK_KEY` を、アカウントマネージャーから提供された値に置き換えてください。

```javascript
<script src="https://cdn.p-n.io/sdk/web/latest/pushly-sdk.min.js?domain_key=SDK_KEY" async></script>
<script>
  window.PushlySDK = window.PushlySDK || [];
  function pushly() { window.PushlySDK.push(arguments) }
  pushly('load', {
    domainKey: 'SDK_KEY'
  });
</script>
```

{% endtab %}
{% endtabs %}

厳格なCSPまたはSubresource Integrity（SRI）が必要ですか？詳細は [配信とセキュリティ（SRI）](/pushly-ja/integration/webpusshu/sdk/tosekyuritisri.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://documentation.pushly.com/pushly-ja/integration/webpusshu/kuikkusutto.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
