$npx -y skills add adrianhajdin/skild --skill firebase-app-hosting-basicsDeploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.
| 1 | # App Hosting Basics |
| 2 | |
| 3 | ## Description |
| 4 | This skill enables the agent to deploy and manage modern, full-stack web applications (Next.js, Angular, etc.) using Firebase App Hosting. |
| 5 | |
| 6 | **Important**: In order to use App Hosting, your Firebase project must be on the Blaze pricing plan. Direct the user to https://console.firebase.google.com/project/_/overview?purchaseBillingPlan=metered to upgrade their plan. |
| 7 | |
| 8 | ## Hosting vs App Hosting |
| 9 | |
| 10 | **Choose Firebase Hosting if:** |
| 11 | - You are deploying a static site (HTML/CSS/JS). |
| 12 | - You are deploying a simple SPA (React, Vue, etc. without SSR). |
| 13 | - You want full control over the build and deploy process via CLI. |
| 14 | |
| 15 | **Choose Firebase App Hosting if:** |
| 16 | - You are using a supported full-stack framework like Next.js or Angular. |
| 17 | - You need Server-Side Rendering (SSR) or ISR. |
| 18 | - You want an automated "git push to deploy" workflow with zero configuration. |
| 19 | |
| 20 | ## Deploying to App Hosting |
| 21 | |
| 22 | ### Deploy from Source |
| 23 | |
| 24 | This is the recommended flow for most users. |
| 25 | 1. Configure `firebase.json` with an `apphosting` block. |
| 26 | ```json |
| 27 | { |
| 28 | "apphosting": { |
| 29 | "backendId": "my-app-id", |
| 30 | "rootDir": "/", |
| 31 | "ignore": [ |
| 32 | "node_modules", |
| 33 | ".git", |
| 34 | "firebase-debug.log", |
| 35 | "firebase-debug.*.log", |
| 36 | "functions" |
| 37 | ] |
| 38 | } |
| 39 | } |
| 40 | ``` |
| 41 | 2. Create or edit `apphosting.yaml`- see [Configuration](references/configuration.md) for more information on how to do so. |
| 42 | 3. If the app needs safe access to sensitive keys, use `npx -y firebase-tools@latest apphosting:secrets` commands to set and grant access to secrets. |
| 43 | 4. Run `npx -y firebase-tools@latest deploy` when you are ready to deploy. |
| 44 | |
| 45 | ### Automated deployment via GitHub (CI/CD) |
| 46 | |
| 47 | Alternatively, set up a backend connected to a GitHub repository for automated deployments "git push" deployments. |
| 48 | This is only recommended for more advanced users, and is not required to use App Hosting. |
| 49 | See [CLI Commands](references/cli_commands.md) for more information on how to set this up using CLI commands. |
| 50 | |
| 51 | ## Emulation |
| 52 | |
| 53 | See [Emulation](references/emulation.md) for more information on how to test your app locally using the Firebase Local Emulator Suite. |