productivity
Buy Me a Coffee Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Buy Me a Coffee KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.buymeacoffee.*.
Use lua_read_doc("integrations.buymeacoffee") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Buy Me a Coffee workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.buymeacoffee.list_supporters({page = 1}))' --json kosmo integrations:lua --eval 'print(docs.read("buymeacoffee"))' --json
kosmo integrations:lua --eval 'print(docs.read("buymeacoffee.list_supporters"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local buymeacoffee = app.integrations.buymeacoffee
local result = buymeacoffee.list_supporters({page = 1})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.buymeacoffee, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.buymeacoffee.default.* or app.integrations.buymeacoffee.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Buy Me a Coffee, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Buy Me a Coffee — Lua API Reference
list_supporters
List all supporters in your Buy Me a Coffee account.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1) |
Example
local result = app.integrations.buymeacoffee.list_supporters()
for _, supporter in ipairs(result.supporters) do
print(supporter.supporter_name .. " — $" .. supporter.support_amount .. " (" .. supporter.support_id .. ")")
end
get_supporter
Get detailed information about a single Buy Me a Coffee supporter.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
supporter_id | string | yes | The ID of the supporter to retrieve |
Example
local result = app.integrations.buymeacoffee.get_supporter({
supporter_id = "12345"
})
print(result.supporter_name)
print(result.support_amount)
print(result.support_note)
list_subscriptions
List all active recurring subscriptions.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1) |
Example
local result = app.integrations.buymeacoffee.list_subscriptions()
for _, sub in ipairs(result.subscriptions) do
print(sub.supporter_name .. " — $" .. sub.support_amount .. " — " .. sub.status)
end
list_extras
List all extras (additional purchase options) in your Buy Me a Coffee account.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1) |
Example
local result = app.integrations.buymeacoffee.list_extras()
for _, extra in ipairs(result.extras) do
print(extra.title .. " — $" .. extra.price .. " — " .. extra.purchases .. " purchases")
end
get_extra
Get detailed information about a single extra.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
extra_id | string | yes | The ID of the extra to retrieve |
Example
local result = app.integrations.buymeacoffee.get_extra({
extra_id = "67890"
})
print(result.title)
print(result.description)
print(result.price)
list_shops
List all shop items in your Buy Me a Coffee account.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1) |
Example
local result = app.integrations.buymeacoffee.list_shops()
for _, item in ipairs(result.shops) do
print(item.title .. " — $" .. item.price)
end
get_current_user
Get the profile of the currently authenticated Buy Me a Coffee user.
Parameters
None.
Example
local result = app.integrations.buymeacoffee.get_current_user()
print("Connected as: " .. result.user_name)
print("Email: " .. result.email)
Multi-Account Usage
If you have multiple Buy Me a Coffee accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.buymeacoffee.function_name({...})
-- Explicit default (portable across setups)
app.integrations.buymeacoffee.default.function_name({...})
-- Named accounts
app.integrations.buymeacoffee.main_page.function_name({...})
app.integrations.buymeacoffee.side_project.function_name({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Buy Me a Coffee — Lua API Reference
## list_supporters
List all supporters in your Buy Me a Coffee account.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
### Example
```lua
local result = app.integrations.buymeacoffee.list_supporters()
for _, supporter in ipairs(result.supporters) do
print(supporter.supporter_name .. " — $" .. supporter.support_amount .. " (" .. supporter.support_id .. ")")
end
```
---
## get_supporter
Get detailed information about a single Buy Me a Coffee supporter.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `supporter_id` | string | yes | The ID of the supporter to retrieve |
### Example
```lua
local result = app.integrations.buymeacoffee.get_supporter({
supporter_id = "12345"
})
print(result.supporter_name)
print(result.support_amount)
print(result.support_note)
```
---
## list_subscriptions
List all active recurring subscriptions.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
### Example
```lua
local result = app.integrations.buymeacoffee.list_subscriptions()
for _, sub in ipairs(result.subscriptions) do
print(sub.supporter_name .. " — $" .. sub.support_amount .. " — " .. sub.status)
end
```
---
## list_extras
List all extras (additional purchase options) in your Buy Me a Coffee account.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
### Example
```lua
local result = app.integrations.buymeacoffee.list_extras()
for _, extra in ipairs(result.extras) do
print(extra.title .. " — $" .. extra.price .. " — " .. extra.purchases .. " purchases")
end
```
---
## get_extra
Get detailed information about a single extra.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `extra_id` | string | yes | The ID of the extra to retrieve |
### Example
```lua
local result = app.integrations.buymeacoffee.get_extra({
extra_id = "67890"
})
print(result.title)
print(result.description)
print(result.price)
```
---
## list_shops
List all shop items in your Buy Me a Coffee account.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
### Example
```lua
local result = app.integrations.buymeacoffee.list_shops()
for _, item in ipairs(result.shops) do
print(item.title .. " — $" .. item.price)
end
```
---
## get_current_user
Get the profile of the currently authenticated Buy Me a Coffee user.
### Parameters
None.
### Example
```lua
local result = app.integrations.buymeacoffee.get_current_user()
print("Connected as: " .. result.user_name)
print("Email: " .. result.email)
```
---
## Multi-Account Usage
If you have multiple Buy Me a Coffee accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.buymeacoffee.function_name({...})
-- Explicit default (portable across setups)
app.integrations.buymeacoffee.default.function_name({...})
-- Named accounts
app.integrations.buymeacoffee.main_page.function_name({...})
app.integrations.buymeacoffee.side_project.function_name({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.buymeacoffee.list_supporters({page = 1})
print(result) Functions
list_supporters Read
List all supporters in your Buy Me a Coffee account. Returns supporter names, emails, support amounts, and dates.
- Lua path
app.integrations.buymeacoffee.list_supporters- Full name
buymeacoffee.buymeacoffee_list_supporters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
get_supporter Read
Get detailed information about a single Buy Me a Coffee supporter by their ID. Returns full supporter data including support history and notes.
- Lua path
app.integrations.buymeacoffee.get_supporter- Full name
buymeacoffee.buymeacoffee_get_supporter
| Parameter | Type | Required | Description |
|---|---|---|---|
supporter_id | string | yes | The ID of the supporter to retrieve. |
list_subscriptions Read
List all active recurring subscriptions in your Buy Me a Coffee account. Returns subscriber details, amounts, and status.
- Lua path
app.integrations.buymeacoffee.list_subscriptions- Full name
buymeacoffee.buymeacoffee_list_subscriptions
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
list_extras Read
List all extras (additional purchase options) in your Buy Me a Coffee account. Returns extra names, descriptions, and pricing.
- Lua path
app.integrations.buymeacoffee.list_extras- Full name
buymeacoffee.buymeacoffee_list_extras
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
get_extra Read
Get detailed information about a single Buy Me a Coffee extra by its ID. Returns full extra data including description, pricing, and purchase count.
- Lua path
app.integrations.buymeacoffee.get_extra- Full name
buymeacoffee.buymeacoffee_get_extra
| Parameter | Type | Required | Description |
|---|---|---|---|
extra_id | string | yes | The ID of the extra to retrieve. |
list_shops Read
List all shop items in your Buy Me a Coffee account. Returns shop item names, descriptions, prices, and availability.
- Lua path
app.integrations.buymeacoffee.list_shops- Full name
buymeacoffee.buymeacoffee_list_shops
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
get_current_user Read
Get the profile of the currently authenticated Buy Me a Coffee user. Useful to verify the connection and see account details.
- Lua path
app.integrations.buymeacoffee.get_current_user- Full name
buymeacoffee.buymeacoffee_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||