All skills
firebase avatar

/firebase-app-hosting-basics

@073edf7
by firebasefirebase/skills461 stars
102

Deploys and manages full-stack web applications (Next.js, Angular) with Server-Side Rendering (SSR) using Firebase App Hosting. Use when deploying Next.js/Angular apps, configuring apphosting.yaml or firebase.json apphosting blocks, managing secrets, setting up GitHub CI/CD, or configuring Blaze billing requirements. Don't use for classic static web hosting, Auth, Firestore, Crashlytics, or Xcode.

Use this Skill: https://skilld.dev/gh/firebase/skills/firebase-app-hosting-basics

This session only. Nothing lands on disk.

referencescli_commands.md

≈805 tokens on demand. Your agent reads this file only when SKILL.md points to it.

App Hosting CLI Commands

The Firebase CLI provides a comprehensive suite of commands to manage App Hosting resources. These commands are often faster and more scriptable than using the Firebase Console.

Initialization

npx -y firebase-tools@latest init apphosting

  • Purpose: Interactive command that sets up App Hosting in your local project. Use this command only if you are able to handle interactive CLI inputs well. Alternatively, you can manually edit firebase.json and apphosting.yml.

  • Effect:

    • Detects your web framework.
    • Creates/updates apphosting.yaml.
    • Can optionally create a backend if one doesn't exist.

Backend Management

npx -y firebase-tools@latest apphosting:backends:list

  • Purpose: Lists all backends in the current project.

npx -y firebase-tools@latest apphosting:backends:get <backend-id>

  • Purpose: Shows details for a specific backend.

npx -y firebase-tools@latest apphosting:backends:delete <backend-id>

  • Purpose: Deletes a backend and its associated resources.

npx -y firebase-tools@latest apphosting:rollouts:list <backend-id>

  • Purpose: Lists the history of rollouts for a backend.

Secrets Management

App Hosting uses Cloud Secret Manager to securely handle sensitive environment variables (like API keys).

npx -y firebase-tools@latest apphosting:secrets:set <secret-name>

  • Purpose: Creates or updates a secret in Cloud Secret Manager and makes it available to App Hosting.
  • Behavior: Prompts for the secret value (hidden input).

npx -y firebase-tools@latest apphosting:secrets:grantaccess <secret-name>

  • Purpose: Grants the App Hosting service account permission to access the secret.
  • Note: Often handled automatically by secrets:set, but useful for debugging permission issues or granting access to existing secrets.

Automated deployment via GitHub (CI/CD)

IMPORTANT Only use these commands if you are setting up automated deployments via GitHub. If you are managing deployments using npx -y firebase-tools@latest deploy, DO NOT use these commands.

npx -y firebase-tools@latest apphosting:rollouts:create <backend-id>

  • Purpose: Manually triggers a new rollout (deployment).
  • Options:
    • --git-branch <branch>: Deploy the latest commit from a specific branch.
    • --git-commit <commit-hash>: Deploy a specific commit.
  • Use Case: Useful for redeploying without code changes, or rolling back to a specific commit.

npx -y firebase-tools@latest apphosting:backends:create

  • Purpose: Creates a new App Hosting backend. Use this when setting up automated deployments via GitHub.
  • Options:
    • --app <webAppId>: The ID of an existing Firebase web app to associate with the backend.
    • --backend <backendId>: The ID of the new backend.
    • --primary-region <location>: The primary region for the backend.
    • --root-dir <rootDir>: The root directory for the backend. If omitted, defaults to the root directory of the project.
    • --service-account <service-account>: The service account used to run the server. If omitted, defaults to the default service account.

Source: SKILL.md on GitHub

1 warning17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides instructions for managing Firebase App Hosting using official tools and CLI commands. It uses resources from the trusted vendor (Firebase) for deployment, secret management, and project configuration. The behaviors described are standard for the skill's stated purpose and do not represent a security risk beyond the typical surface for development tools.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer6mo

    2/4 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 073edf7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 2 months ago
metadata
{
  "category": "Serverless"
}
  • Next.js
  • firebase
  • app-hosting
  • angular
  • ssr
  • deployment
  • full-stack
  • cicd

README badge

README badge for firebase/skills/firebase-app-hosting-basics

Deploys full-stack web applications like Next.js and Angular to Firebase App Hosting with server-side rendering and automated git-push-to-deploy workflows. Requires a Blaze pricing plan and handles secrets management via CLI.

Generated from the current SKILL.md.

Does my Firebase project need to be on a specific pricing plan to use App Hosting?
Yes. Your Firebase project must be on the Blaze pricing plan (pay-as-you-go). You can upgrade at https://console.firebase.google.com/project/_/overview?purchaseBillingPlan=metered.
What frameworks does App Hosting support?
App Hosting is designed for full-stack frameworks like Next.js and Angular that support Server-Side Rendering (SSR) or Incremental Static Regeneration (ISR).
Should I use App Hosting or Firebase Hosting?
Use App Hosting if you're deploying a full-stack framework like Next.js or Angular with SSR; use Firebase Hosting if you're deploying a static site or simple single-page app without server-side rendering.
Can I set up automated deployments from GitHub?
Yes, App Hosting supports automated "git push to deploy" workflows via GitHub CI/CD, though this is recommended for advanced users and not required to use App Hosting.
How do I manage sensitive keys and credentials?
Use the `npx firebase-tools@latest apphosting:secrets` commands to securely set and grant access to sensitive environment variables.

Generated from the current SKILL.md. These answers refresh after source changes.