首页龙虾技能列表 › Supabase — Supabase工具

Supabase — Supabase工具

v1.0.0

[AI辅助] Supabase API integration with managed authentication. Access database tables via PostgREST, manage auth users, and handle storage buckets. Use this skill whe...

1· 151·0 当前·0 累计
by @byungkyu·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/30
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
This is an instruction-only Supabase integration that consistently uses a Maton gateway and requires only a single MATON_API_KEY — the requested access and instructions align with the described purpose.
评估建议
This skill delegates Supabase access through Maton (gateway.maton.ai / ctrl.maton.ai) and requires your MATON_API_KEY. Before installing, confirm you trust Maton with access to any Supabase projects you connect and that the MATON_API_KEY has least-privilege (limited scope/expiry) where possible. Review Maton's privacy/security docs and consider creating a limited gateway connection or dedicated service account rather than using a broad personal key. Because this is an instruction-only skill, the...
详细分析 ▾
用途与能力
The skill exposes Supabase PostgREST, auth, and storage via a Maton gateway. The only declared requirement is MATON_API_KEY, which is appropriate for a gateway-based integration.
指令范围
SKILL.md contains concrete HTTP examples that call the Maton gateway and control endpoints; it does not instruct the agent to read unrelated local files, other environment variables, or exfiltrate data to unexpected endpoints.
安装机制
No install spec or code files — instruction-only. Nothing is downloaded or written to disk by an installer.
凭证需求
Only one environment variable (MATON_API_KEY) is required and is justified by the gateway authentication described in the docs. No unrelated credentials or config paths are requested.
持久化与权限
The skill is not forced-always and uses normal, user-invocable/autonomous invocation defaults. It does not request system-wide persistence or modify other skills' settings.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/30

- Initial release of Supabase API integration. - Enables managed authentication and access to Supabase database tables, auth users, and storage buckets via the Maton Gateway. - Provides API reference for querying tables, managing users, and using storage. - Includes connection management and usage examples with required environment variable (MATON_API_KEY). - Documentation for common operations with sample Python code and endpoint details.

● 无害

安装命令 点击复制

官方npx clawhub@latest install supabase-api
镜像加速npx clawhub@latest install supabase-api --registry https://cn.clawhub-mirror.com

技能文档

Access the Supabase API with managed authentication. Query database tables via PostgREST, manage auth users, and handle storage buckets.

Quick 开始

# List storage buckets
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/supabase/storage/v1/bucket')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Base URL

https://gateway.maton.ai/supabase/{service}/{native-api-path}

The gateway proxies requests to your connected Supabase project. Services include:

  • rest/v1 - PostgREST API (数据库 tables)
  • auth/v1 - GoTrue authentication API
  • storage/v1 - Storage API

Authentication

All requests require the Maton API key in the Authorization header:

Authorization: Bearer $MATON_API_KEY

Environment 变量: 设置 API 键 作为 MATON_API_KEY:

export MATON_API_KEY="YOUR_API_KEY"

Getting API 键

连接 Management

Manage your Supabase connections at https://ctrl.maton.ai.

列表 Connections

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=supabase&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

创建 连接

python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'supabase'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

获取 连接

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:

{
  "connection": {
    "connection_id": "c22a6ea6-4cf6-42a0-9e1c-d81ca8d6fc7e",
    "status": "ACTIVE",
    "creation_time": "2026-03-29T22:47:35.570344Z",
    "last_updated_time": "2026-03-29T22:48:23.435225Z",
    "url": "https://connect.maton.ai/?session_token=...",
    "app": "supabase",
    "metadata": {}
  }
}

Open the returned url in a browser to complete authentication setup.

删除 连接

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Specifying 连接

If you have multiple Supabase connections, specify which one to use with the Maton-Connection header:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/supabase/storage/v1/bucket')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', 'c22a6ea6-4cf6-42a0-9e1c-d81ca8d6fc7e')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

If omitted, the gateway uses the default (oldest) active connection.

API Reference

数据库 (PostgREST)

The PostgREST API auto-generates endpoints based on your database schema. Access tables and views in the public schema.

获取 OpenAPI Schema

GET /supabase/rest/v1/

Returns the OpenAPI specification describing all available tables and endpoints.

列表 Records 从 表

GET /supabase/rest/v1/{table_name}

查询 Parameters:

  • select - Columns 到 return (e.g., select=id,name,email)
  • order - 排序 order (e.g., order=created_at.desc)
  • limit - Maximum records 到 return
  • offset - 数字 的 records 到 skip

示例:

GET /supabase/rest/v1/users?select=id,email&order=created_at.desc&limit=10

获取 Single 记录

GET /supabase/rest/v1/{table_name}?id=eq.{id}&select=

Insert Records

POST /supabase/rest/v1/{table_name}
Content-Type: application/json
Prefer: return=representation

{ "name": "John Doe", "email": "john@example.com" }

更新 Records

PATCH /supabase/rest/v1/{table_name}?id=eq.{id}
Content-Type: application/json
Prefer: return=representation

{ "name": "Jane Doe" }

删除 Records

DELETE /supabase/rest/v1/{table_name}?id=eq.{id}

Filtering Operators

OperatorMeaningExample
eqEquals?status=eq.active
neqNot equals?status=neq.deleted
gtGreater than?age=gt.18
gteGreater than or equal?age=gte.18
ltLess than?age=lt.65
lteLess than or equal?age=lte.65
likePattern match?name=like.john
ilikeCase-insensitive pattern?name=ilike.john*
inIn list?status=in.(active,pending)
isIs null/true/false?deleted_at=is.null

Auth (GoTrue)

获取 Auth Health

GET /supabase/auth/v1/health

响应:

{
  "version": "v2.188.1",
  "name": "GoTrue",
  "description": "GoTrue is a user registration and authentication API"
}

获取 Auth Settings

GET /supabase/auth/v1/settings

响应:

{
  "external": {
    "email": true,
    "phone": false,
    "google": false,
    "github": false
  },
  "disable_signup": false,
  "mailer_autoconfirm": false
}

列表 Users (管理员)

GET /supabase/auth/v1/admin/users

响应:

{
  "users": [
    {
      "id": "8974a9fa-95c4-4839-8d50-76f4666d2113",
      "email": "user@example.com",
      "email_confirmed_at": "2026-03-29T23:01:46.718322Z",
      "created_at": "2026-03-29T23:01:46.689584Z"
    }
  ],
  "aud": "authenticated"
}

获取 用户 (管理员)

GET /supabase/auth/v1/admin/users/{user_id}

创建 用户 (管理员)

POST /supabase/auth/v1/admin/users
Content-Type: application/json

{ "email": "newuser@example.com", "password": "securepassword123", "email_confirm": true }

响应:

{
  "id": "8974a9fa-95c4-4839-8d50-76f4666d2113",
  "email": "newuser@example.com",
  "email_confirmed_at": "2026-03-29T23:01:46.718322Z",
  "role": "authenticated",
  "app_metadata": {
    "provider": "email",
    "providers": ["email"]
  }
}

更新 用户 (管理员)

PUT /supabase/auth/v1/admin/users/{user_id}
Content-Type: application/json

{ "email": "updated@example.com", "user_metadata": { "name": "Updated Name" } }

删除 用户 (管理员)

DELETE /supabase/auth/v1/admin/users/{user_id}

Storage

列表 Buckets

GET /supabase/storage/v1/bucket

响应:

[
  {
    "id": "avatars",
    "name": "avatars",
    "public": true,
    "created_at": "2026-03-29T23:01:06.638Z",
    "updated_at": "2026-03-29T23:01:06.638Z"
  }
]

获取 Bucket

GET /supabase/storage/v1/bucket/{bucket_id}

创建 Bucket

POST /supabase/storage/v1/bucket
Content-Type: application/json

{ "id": "documents", "name": "documents", "public": false, "file_size_limit": 10485760, "allowed_mime_types": ["application/pdf", "image/png"] }

更新 Bucket

PUT /supabase/storage/v1/bucket/{bucket_id}
Content-Type: application/json

{ "public": true }

删除 Bucket

DELETE /supabase/storage/v1/bucket/{bucket_id}

列表 Objects 在...中 Bucket

POST /supabase/storage/v1/object/list/{bucket_id}
Content-Type: application/json

{ "prefix": "", "limit": 100, "offset": 0 }

上传 对象

POST /supabase/storage/v1/object/{bucket_id}/{path}
Content-Type: {mime_type}

{binary_data}

下载 对象

GET /supabase/storage/v1/object/{bucket_id}/{path}

删除 对象

DELETE /supabase/storage/v1/object/{bucket_id}/{path}

分页

PostgREST 分页

Use limit and offset query parameters:

GET /supabase/rest/v1/users?limit=10&offset=20

Use the Range header for range-based pagination:

GET /supabase/rest/v1/users
Range: 0-9

Auth 用户 分页

GET /supabase/auth/v1/admin/users?page=1&per_page=50

Code Examples

JavaScript

// List storage buckets
const response = await fetch(
  'https://gateway.maton.ai/supabase/storage/v1/bucket',
  {
    headers: {
      'Authorization': Bearer ${process.env.MATON_API_KEY}
    }
  }
);
const buckets = await response.json();

Python

import os
import requests

# Query database table response = requests.get( 'https://gateway.maton.ai/supabase/rest/v1/users', headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}, params={'select': 'id,email', 'limit': 10} ) users = response.json()

创建 用户 和 Storage Bucket

import os
import requests

headers = { 'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}', 'Content-Type': 'application/json' }

# Create auth user user_resp = requests.post( 'https://gateway.maton.ai/supabase/auth/v1/admin/users', headers=headers, json={ 'email': 'test@example.com', 'password': 'securepass123', 'email_confirm': True } ) user = user_resp.json()

# Create storage bucket bucket_resp = requests.post( 'https://gateway.maton.ai/supabase/storage/v1/bucket', headers=headers, json={ 'id': 'user-uploads', 'name': 'user-uploads', 'public': False } ) bucket = bucket_resp.json()

Notes

  • 连接 routes 到 specific Supabase project configured 期间 setup
  • PostgREST endpoints auto-generated 从 数据库 schema
  • 使用 Prefer: return=representation 页头 到 获取 created/updated records back
  • Storage bucket names 必须 unique 在...内 project
  • Auth 管理员 endpoints require 服务 角色 permissions
  • 数据库 queries support complex filtering, ordering, 和 joins 通过 PostgREST syntax
  • IMPORTANT: 当...时 使用 curl commands, 使用 curl -g 当...时 URLs contain brackets 或 special characters
  • IMPORTANT: 当...时 piping curl 输出 到 jq, environment variables 可能 不 expand correctly 在...中 一些 shells

错误 Handling

StatusMeaning
400Missing Supabase connection or invalid request
401Invalid or missing Maton API key
404Table or resource not found
409Conflict (e.g., duplicate bucket name)
429Rate limited
4xx/5xxPassthrough error from Supabase API

PostgREST Errors

{
  "code": "PGRST205",
  "details": null,
  "hint": null,
  "message": "Could not find the table 'public.users' in the schema cache"
}

Resources

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务