Nhost API
Nhost API
Nhost 是开源 Firebase 替代品:Hasura GraphQL + Postgres + auth + storage + serverless functions 的托管 BaaS。
Hasura 自动从 Postgres schema 生成 GraphQL API
生态比 Supabase 小
nhost.io 注册 + 创建 app。JS SDK: const nhost = new NhostClient({subdomain: "...", region: "..."}); await nhost.auth.signUp({email, password});
可用率 · 30 天窗口
关于这个 API
Nhost 是 2020 年瑞典创办的开源 BaaS,技术栈核心是 Hasura——Hasura 是个开源工具,能从 Postgres schema 自动生成 GraphQL API(你 CREATE TABLE users 它自动给你 users / users_aggregate 等 GraphQL fields)。Nhost 把 Hasura + Postgres + 自家 auth + S3 storage + serverless functions 打包成托管 BaaS。差异化卖点 vs Supabase:GraphQL 优先 (Supabase 主推 REST + PostgREST,GraphQL 是次要)。适合喜欢 GraphQL 体验的前端开发者。生态比 Supabase 小一些,但在 GraphQL 圈子里有一席之地。开源 (MIT) + 自托管选项。
你可以做什么
- 1GraphQL 优先的应用 backend
- 2Hasura + Postgres 组合的托管服务
- 3替代 Firebase 但要 SQL 关系数据 + GraphQL
优劣对比
优点
- Hasura 自动从 Postgres schema 生成 GraphQL API
- Postgres + GraphQL + auth + storage 一体
- 开源 (MIT)
注意事项
- 生态比 Supabase 小
- GraphQL 学习曲线(团队要熟悉)
- 依赖 Hasura(Hasura 自身有 license 改变历史)
示例请求
curl https://nhost.io/<endpoint> \
-H "Authorization: Bearer $ACCESS_TOKEN"快速开始
nhost.io 注册 + 创建 app。JS SDK: const nhost = new NhostClient({subdomain: "...", region: "..."}); await nhost.auth.signUp({email, password});
常见问题
Nhost vs Supabase?+
GraphQL 优先:Nhost。REST + Postgres 直接用:Supabase。
技术细节
- 认证方式
- jwt
- 计费
- freemium
- 速率限制
- 按 plan
- 协议
- GraphQL, REST
- SDK
- javascript, typescript, react, vue, angular