BananaPrompts SDK for Elixir
bananaprompts_sdk is the official Elixir SDK for the BananaPrompts API.
It gives Elixir developers a clean client for discovering trending prompts,
browsing category templates, and searching reusable prompt patterns.
The package is intentionally lightweight:
- typed public structs for clients, responses, and errors
-
a thin request layer built on
Req - convenience helpers for prompt discovery endpoints
- package metadata prepared for Hex publishing
Installation
Add the dependency to your mix.exs:
def deps do
[
{:bananaprompts_sdk, "~> 0.1.0"}
]
endThen fetch dependencies:
mix deps.getQuick Start
client =
BananapromptsSDK.new(
api_key: System.fetch_env!("BANANAPROMPTS_API_KEY")
)
{:ok, response} =
BananapromptsSDK.list_trending_prompts(client, params: %{limit: 10})
response.status
response.bodyBuilt-In Helpers
Fetch trending prompts:
BananapromptsSDK.list_trending_prompts(client, params: %{limit: 20, timeframe: "7d"})Browse templates by category:
BananapromptsSDK.list_category_templates(client, "marketing", params: %{limit: 25})Search prompt templates:
BananapromptsSDK.search_templates(client, "product launch email", params: %{limit: 10})Configuration
The client accepts these options:
:api_key- API key used for authenticated requests:base_url- defaults tohttps://bananaprompts.org:api_key_header- defaults to"authorization":api_key_prefix- defaults to"Bearer":headers- additional request headers:receive_timeout- request timeout in milliseconds:req_options- rawReqoptions merged into each request
Generic Requests
You can still call lower-level helpers for endpoints not yet wrapped:
BananapromptsSDK.get(client, "/v1/collections/featured")BananapromptsSDK.request(client, :post, "/v1/prompts/bookmarks", body: %{prompt_id: "pr_123"})Publishing Notes
Before the next public release, update these items:
-
replace the
@source_url_placeholderinmix.exswith the public repository URL - align helper function paths with the production BananaPrompts API contract
- expand tests around pagination, filtering, and authentication failures
Official Links
- Homepage: https://bananaprompts.org/
- Official documentation and support: https://bananaprompts.org/
License
MIT