> For the complete documentation index, see [llms.txt](https://ja.docs.monaca.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ja.docs.monaca.io/products_guide/monaca_ide/monaca_ci/firebase.md).

# Firebase への配信

[Firebase](https://firebase.google.com) への配信方法について説明します。\
Firebaseへの配信は、[Firebase Hosting機能](https://firebase.google.com/docs/hosting/quickstart?hl=ja)を利用しています。また、Firebaseへの配信は、PWAビルドされたアプリのみ対応しています。

## 準備

配信のするための事前準備として、`プロジェクトID`と`APIトークン`を用意する必要があります。

### プロジェクトID

1. [Firebaseコンソール](https://console.firebase.google.com)にて、プロジェクトを作成します。
2. プロジェクトIDは、下の赤枠に表示されます。

![](/files/-MgzMEi5BNhIgz1h4cC0)

### API トークンの取得方法

1. [Firebase CLI ガイド](https://firebase.google.com/docs/hosting/quickstart?hl=ja) に沿って`Firebase CLI をインストール`します。
2. Firebase CLIをインストールした後、次のコマンドにてトークンを取得します。

```bash
firebase login:ci
```

### firebase.jsonファイル

初期化後、Firebaseはfirebase.jsonファイルをローカルプロジェクトのルートに追加します。このファイルをMonacaの対象プロジェクトのルートに追加する必要があります。

## デプロイサービスの登録

事前に用意したFirebaseの情報をMonacaへ登録する方法は、次のとおりです。

1. Monaca クラウド IDE メニュー&#x306E;**`設定 → デプロイサービス`**&#x3092;選択します。
2. &#x20;`新しく追加する`をクリックします。
3. `Firebase` を選択し、以下の必要情報を入力します。
   * `エイリアス名`: 各サービスの一意の識別子 (Monaca内で管理するための識別子)
   * `API トークン`: Firebase CLI で取得した API トークン
   * `プロジェクト ID`: Firebase コンソールから取得したID
4. &#x20;`追加`をクリックします。

## デプロイを実施

登録したデプロイサービスを利用して、Firebaseへの配信を行います。

1. PWAビルドを行います。ビルドの手順は、[PWA アプリのビルド](/products_guide/monaca_ide/build/build_pwa.md)を参照ください。
2. ビルド完了後に、ビルド結果画面に遷移します。
3. ビルド結果画面からデプロイを実行します。画面下部に登録したデプロイサービスが表示されますので、クリックし配信を開始します。

![](/files/-MgzMfm3DowMHUxpPlSM)


---

# 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://ja.docs.monaca.io/products_guide/monaca_ide/monaca_ci/firebase.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.
