bunny-graphql
- Repo stars 0
- Author updated Live
- Author repo skills-registry
- Domain
- Engineering
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @tomevault-io · no license declared
- Token usage
- Heavy
- Setup complexity
- Manual integration
- External API key
- Required · Vendor-specific
- Operating systems
- macOS · Linux · Windows
- Runtime requirements
- Node.js · Python
- Permissions
-
- Read-only
- Write / modify
- Env read
- Network behavior
- External requests
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: bunny-graphql
description: Direct GraphQL API integration with Bunny — the subscription billing and management platform. Co…
category: engineering
runtime: Node.js / Python
---
# bunny-graphql output preview
## PART A: Task fit
- Use case: Direct GraphQL API integration with Bunny — the subscription billing and management platform. Covers the endpoint URL (https://<subdomain>.bunny.com/graphql), Bearer-token authentication, OAuth2 client-credentials flow with automatic token refresh, pagination via Relay-style connections, error response shape, and the most common queries and mutations for accounts, subscriptions, quotes, invoices, and payments. Use when calling Bunny's GraphQL API from a language without an official SDK (Go, Python, Rust, Elixir, PHP, Java, .NET, etc.), when the Node or Ruby SDKs don't cover an operation you need, or when you need to understand the raw request / response shape. For Node prefer the `bunny-node-sdk` skill; for Ruby prefer the `bunny-ruby-sdk` skill. Use when this capability is needed..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Credential safety / Endpoint / Authentication” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Direct GraphQL API integration with Bunny — the subscription billing and management platform. Covers the endpoint URL (https://<subdomain>.bunny.com/graphql), Bearer-token authentication, OAuth2 client-credentials flow with automatic token refresh, pagination via Relay-style connections, error response shape, and the most common queries and mutations for accounts, subscriptions, quotes, invoices, and payments. Use when calling Bunny's GraphQL API from a language without an official SDK (Go, Python, Rust, Elixir, PHP, Java, .NET, etc.), when the Node or Ruby SDKs don't cover an operation you need, or when you need to understand the raw request / response shape. For Node prefer the `bunny-node-sdk` skill; for Ruby prefer the `bunny-ruby-sdk` skill. Use when this capability is needed.”.
- **02** When the source has headings, the agent prioritizes “Credential safety / Endpoint / Authentication” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, read environment variables; may access external network resources; requires Vendor-specific API keys.
## Running Rules
- read files, write/modify files, read environment variables; may access external network resources; requires Vendor-specific API keys.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, read environment variables.
Start with a small task and check whether the result follows “Credential safety / Endpoint / Authentication”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: bunny-graphql
description: Direct GraphQL API integration with Bunny — the subscription billing and management platform. Co…
category: engineering
source: tomevault-io/skills-registry
---
# bunny-graphql
## When to use
- Direct GraphQL API integration with Bunny — the subscription billing and management platform. Covers the endpoint URL…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Credential safety / Endpoint / Authentication” and keep inference separate from source facts.
- read files, write/modify files, read environment variables; may access external network resources; requires Vendor-specific API keys.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "bunny-graphql" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Credential safety / Endpoint / Authentication
rules -> SKILL.md triggers / order / output contract
runtime -> Node.js / Python | read files, write/modify files, read environment variables | may access external network resources
guardrails -> requires Vendor-specific API keys + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Bunny GraphQL
Bunny exposes its full API as a single GraphQL endpoint per tenant. This skill covers calling it directly over HTTPS — auth, pagination, errors, and the operations integrators reach for most.
For official docs, see docs.bunny.com/developer/using-the-graphql-api.
Credential safety
Access tokens grant write access to live billing data. Treat them like database passwords:
- Read tokens from environment variables only (
process.env.BUNNY_ACCESS_TOKEN,ENV['BUNNY_ACCESS_TOKEN'],os.getenv("BUNNY_ACCESS_TOKEN")). Never inline. - Never log request bodies or auth headers — token values will leak into log aggregators otherwise.
- Never ship tokens to client-side JavaScript bundles — they belong on your server.
- Don't commit
.envfiles. Use your platform's secret manager in production (Doppler, Vault, AWS Secrets Manager, Rails credentials, etc.). - Rotate tokens regularly and scope each token to the minimum set of permissions it needs.
Endpoint
https://<subdomain>.bunny.com/graphql
Replace <subdomain> with your Bunny tenant's subdomain (the part before
.bunny.com in your admin URL).
All requests:
- Use
POST - Set
Content-Type: application/json - Set
Authorization: Bearer <ACCESS_TOKEN>
Authentication
Bunny supports two auth modes. Pick based on how long your process runs.
Access token (simplest)
Generate a long-lived access token in the admin portal: Settings → API Clients → Default API client → Generate Access Token.
Use it directly in the Authorization header. No token exchange needed.
curl -sS "https://example.bunny.com/graphql" \
-H "Authorization: Bearer $BUNNY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query":"{ currentUser { scopes user { id name email } } }"}'
Downside: if the token expires or is rotated, your requests fail until you update the env var.
OAuth2 client credentials (recommended for long-running services)
Create an API Client in the admin portal and get a client_id, client_secret,
and scope. Exchange them for a short-lived access token; refresh
automatically when it expires.
const {
BUNNY_BASE_URL, // e.g. https://example.bunny.com
BUNNY_CLIENT_ID,
BUNNY_CLIENT_SECRET,
BUNNY_SCOPE = "standard:read standard:write",
} = process.env;
let cached: { token: string; expiresAt: number } | null = null;
async function accessToken(): Promise<string> {
if (cached && Date.now() < cached.expiresAt - 60_000) return cached.token;
const res = await fetch(`${BUNNY_BASE_URL}/oauth/token`, {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
grant_type: "client_credentials",
client_id: BUNNY_CLIENT_ID!,
client_secret: BUNNY_CLIENT_SECRET!,
scope: BUNNY_SCOPE,
}),
});
if (!res.ok) throw new Error(`Token exchange failed: ${res.status}`);
const body = await res.json();
cached = {
token: body.access_token,
expiresAt: Date.now() + body.expires_in * 1000,
};
return cached.token;
}
export async function graphql<T>(query: string, variables?: object): Promise<T> {
const res = await fetch(`${BUNNY_BASE_URL}/graphql`, {
method: "POST",
headers: {
Authorization: `Bearer ${await accessToken()}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ query, variables: variables ?? {} }),
});
return res.json();
}
Note on units: body.expires_in is seconds (the TypeScript sample
multiplies by 1000 to reach JS epoch milliseconds). Language implementations
that already work in seconds (Python time.time(), Go time.Duration) skip
the multiplication.
If the token endpoint returns {"error":"unauthorized_client","error_description":"The client is not authorized to perform this request using this method."} with otherwise valid credentials, the issue is server-side: the API client's grant_flows array doesn't include client_credentials. Enable it under Settings → API Clients → <your client> in the Bunny admin. The error name is misleading — it sounds like wrong credentials, but it's a client-config mismatch.
The official Node (@bunnyapp/api-client) and Ruby (bunny_app) SDKs handle
this refresh loop for you — prefer them when available. See also
bunny-node-sdk and bunny-ruby-sdk.
Pagination
List queries return Relay-style connections with edges { node } and
pageInfo { endCursor hasNextPage }. Paginate forward by passing after.
query ListAccounts($cursor: String) {
accounts(first: 50, after: $cursor) {
edges {
node { id name state createdAt }
}
pageInfo { endCursor hasNextPage }
}
}
Loop until pageInfo.hasNextPage is false, passing the previous
endCursor as the next cursor. Keep page sizes ≤ 100 to stay well under
request timeouts.
Finding the right operation
Bunny's schema has hundreds of operations and the names don't always match
what you'd guess — e.g. quotes are applied via quoteApplyChanges, not
quoteApply; subscription renewals are driven through a renewal quote
(quoteSubscriptionRenew) rather than a direct mutation. Do not guess
operation names from the user's prompt.
To find the correct operation:
- Use the Bunny dev MCP —
search_docs("<intent>")surfaces the right operation with a link to its docs page;validate_graphql("<document>")confirms the shape before you ship it. - Reach for the sibling skill for the domain area —
bunny-subscriptionsfor lifecycle operations,bunny-quotingfor quote flows,bunny-billingfor invoices / payments / credit notes,bunny-catalogfor products and pricing,bunny-analyticsfor reporting reads. - Introspect the schema directly if you need the exact shape and no doc search is available.
Minimal end-to-end: create an account
Bunny's argument and payload shapes are not the generic input: XxxCreateInput! you may expect from other GraphQL APIs. Validate your
mutation against the live schema before shipping — either via the
Bunny dev MCP (validate_graphql("<document>")) or a one-off
introspection query. The example below is correct as of the Last verified footer; if it rejects with Field doesn't accept argument 'attributes' or similar, the schema has moved.
const QUERY = /* GraphQL */ `
mutation CreateAccount($attributes: AccountAttributes!) {
accountCreate(attributes: $attributes) {
account { id name }
errors
}
}
`;
const res = await fetch(`${process.env.BUNNY_BASE_URL}/graphql`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BUNNY_ACCESS_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: QUERY,
variables: {
attributes: {
name: "Acme Corp",
billingContact: { email: "ap@acme.example" },
},
},
}),
});
const body = await res.json();
if (res.status >= 400) throw new Error(`HTTP ${res.status}: ${JSON.stringify(body)}`);
if (body.errors?.length) throw new Error(body.errors[0].message); // schema OR validation
const payload = body.data.accountCreate;
if (payload?.errors?.length) throw new Error(payload.errors.join("; ")); // auth
const account = payload.account;
Note the three-way error check — see "Error response shape" below for
why validation errors come through top-level errors, not the nested
payload.errors array.
Error response shape
Bunny responses mix five observable failure modes. Inspect them in this order:
HTTP status — transport / uncaught exception. 4xx (commonly 401 on a stale token, 403 on OAuth
unauthorized_client) or 5xx (network, auth service, or an uncaught Rails exception). A 500 body from the Rails backend is still JSON and includes anexceptiontrace — it can look deceptively like a successful GraphQL response until you check the status. Retry 5xx with backoff; fix 4xx.Top-level
errors[]— schema-level. Unknown field, missing required argument, wrong type. Array of GraphQL error objects withmessageandpath. Bug in your query; do not retry.Top-level
errors[]withpath = ["<mutationName>"]anddata.<op>: null— model validation. The most common mutation failure mode: blank required string, invalid email format, illegal state transition. Surface to the caller; do not retry.{ "errors": [ { "message": "Name can't be blank", "path": ["accountCreate"] } ], "data": { "accountCreate": null } }data.<op>.errors: [String!]withdata.<op>.<resource>: null— authorization. Populated only for scope / permission failures, e.g."Missing required permission: write, can't access mutation PortalSessionCreate". The message drops the domain prefix (sayswrite, notportal:write), so it can read as ambiguous. IntrospectcurrentUser { scopes }to confirm what your token actually carries.{ "data": { "portalSessionCreate": { "token": null, "errors": ["Missing required permission: write, can't access mutation PortalSessionCreate"] } } }data.<op>.errorsalongside a populateddata.<op>.<resource>— partial / warnings. Rare. Some mutations return soft-error arrays on otherwise-successful responses. Handle defensively.
Canonical check order in a consumer:
if resp.status_code >= 400: # 1: transport / exception
raise TransportError(resp)
if body.get("errors"): # 2 or 3: schema or validation
# path == [<mutationName>] + data.<op> is None => model validation
raise ApiError(body["errors"])
payload = body["data"]["<op>"]
if payload and payload.get("errors"): # 4 (or 5 if resource is also set)
raise AuthError(payload["errors"])
Do not parse message strings for control flow — they are human-readable
and may change between releases.
Scopes
Access tokens are scoped. Common scopes:
standard:read,standard:write— most day-to-day operationsadmin:read,admin:write— tenant administrationbilling:read,billing:write— invoices, payments, credit notesproduct:read,product:write— catalog managementsecurity:read,security:write— API clients, tokens, auditlegendary:read,legendary:write— advanced / internal operations
Request the narrowest set you need. Full scope list in the admin portal.
Confirming a token's scopes at runtime
Query currentUser { scopes } to see what scopes the current token
actually carries. Useful when a mutation rejects with a scope error and
the message is ambiguous about which scope is missing (see error tier 4
above — the message strips the domain prefix, saying "Missing required
permission: write" rather than "**portal:**write").
Comparing currentUser.scopes against the mutation's
REQUIRED_SCOPES (visible in the schema's SDL comments) is usually the
fastest path from error to fix.
References
- docs.bunny.com/developer/using-the-graphql-api — official docs
- bunnyapp/bunny-node — Node SDK (handles auth + refresh for you)
- bunnyapp/bunny-ruby — Ruby gem (handles auth + refresh for you)
Last verified against bunnyapp/api release 2026-04-21-1
Source: bunnyapp/skills — distributed by TomeVault.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review