Nhost Documentation

website·Indexed 35 days ago

https://docs.nhost.io/

A backend platform for building production apps featuring PostgreSQL, GraphQL, authentication, file storage, and serverless functions. Includes guides for the Nhost CLI and integration tutorials for Next.js, React, React Native, SvelteKit, and Vue.

Tokens
174.5K
Snippets
901
Records
1.3K
Agent score
68%

What's inside Nhost

  1. Overview of Nhost Stack components

    Nhost Stack is a backend-as-a-service platform providing a suite of integrated tools:

    • Database: A PostgreSQL database featuring automated migrations and backups.
    • GraphQL: An instant GraphQL API equipped with a comprehensive permissions system.
    • Auth: A secure authentication system supporting multiple sign-in methods and social providers.
    • Storage: Scalable file storage with built-in permissions and CDN integration.
  2. Overview of Nhost Managed Grafana Metrics

    Nhost provides a managed Grafana instance for Pro, Team, and Enterprise projects (not available on Starter projects). It allows developers to monitor response times, resource usage, and error rates via pre-built dashboards. Monitored metrics include vCPU/memory usage per service replica, throttling percentages, Postgres volume usage, networking errors, and function-specific metrics (calls, response times, errors).
  3. Overview of Nhost CLI development workflows

    The Nhost CLI supports two primary development workflows to manage the Nhost stack (PostgreSQL, GraphQL, Auth, Storage, and custom services):

    1. Local Development: Runs the complete Nhost stack locally on your machine. This is ideal for offline development, fast iteration, and full environment control.
    2. Cloud Development: Develops against cloud infrastructure while using local tools. This is preferred for team collaboration and remote testing.
  4. Overview of Backend MCP Server

    The Backend MCP Server provides an MCP interface for your Nhost backend, exposing your GraphQL API as tools for AI assistants (e.g., Claude, Cursor). It allows users to interact with your application using natural language while ensuring that every GraphQL operation is executed with the authenticated user's existing permissions (row-level and column-level). It is typically deployed alongside your project using Nhost Run.
  5. Overview of Remote Schemas

    Remote Schemas allow you to extend your GraphQL API by integrating external GraphQL services (such as third-party APIs, microservices on Nhost Run, or legacy systems) into a single, unified endpoint. When a Remote Schema is added, its types and operations are merged with your existing GraphQL schema, allowing clients to query both the database and the remote service in a single request.
  6. Overview of Nhost OAuth2 Authorization Code Flow

    The Authorization Code flow is used when a third-party application needs to authenticate a user from a Nhost project. The process involves three parties:

    1. Third-Party App: The external service that initiates the flow and receives tokens.
    2. Nhost Auth: The Nhost auth service that validates requests and issues codes/tokens.
    3. Consent Page: A custom frontend page built by the developer where the user authenticates and approves the access request.

    Nhost Auth automatically handles request validation, redirection to the consent page (via the loginURL in nhost.toml), issuing authorization codes, exchanging codes for tokens, and PKCE validation for public clients.

  7. Overview of Nhost Run for custom container services

    Nhost Run allows you to deploy and execute custom and third-party open-source software (OSS) container services within your Nhost project environment. It is designed to extend backend infrastructure by running workloads in close proximity to the Nhost backend, which eliminates dependency on external internet connectivity for inter-service communication and removes data egress costs between the project and the cloud infrastructure.
  8. Overview of Nhost AI Assistants

    AI Assistants allow you to build custom ChatGPT-powered assistants with scoped access to your data. Access is defined via GraphQL queries, mutations, and webhooks unique to each assistant. AI Assistants are fully integrated with Nhost permissions, ensuring that only data the current user has access to is available during a session.
  9. Overview of the Nhost CLI MCP Server

    The Nhost CLI MCP server is a Model Context Protocol (MCP) implementation that allows AI assistants to interact with Nhost projects. It runs locally on the developer's machine and authenticates using an admin secret or Personal Access Token (PAT). It is primarily used for development tasks such as AI-assisted schema management, metadata changes, and migrations. For production environments where end-users' AI assistants need access, the Backend MCP Server should be used instead.
    nhost mcp start
  10. Overview of the Nhost backend platform

    Nhost is a managed backend development platform designed for building and scaling production-ready applications. It provides a full software stack that includes PostgreSQL, GraphQL, authentication, file storage, and serverless functions, reducing backend complexity while allowing for customization as the application grows.
  11. Overview of Nhost Events

    Nhost Events allow you to trigger HTTP requests (webhooks) to a target URL based on specific triggers. The default request method is POST, but this can be changed to GET, PUT, PATCH, or DELETE using request transformations. Webhook targets can be Nhost Functions, Nhost Run services, or any external API (e.g., Slack, Teams).
  12. Overview of Nhost Backup Options

    Nhost provides different backup strategies based on the project plan:

    • Pro and Team Projects: Include automatic daily backups with a 7-day retention period.
    • Free Projects: Do not have automatic daily backups; users must create manual backups using the connection string and tools like pg_dump.
    • Point-in-Time Recovery (PITR): An optional add-on for critical data that allows restoring the database to any specific moment. When PITR is enabled, standard daily backups are disabled.

    Important Constraints:

    • Backups include database metadata and permissions but do not include storage files (the actual files in storage).
    • Data from Run services is not included in managed backups.