@openpets/polar
v1.0.1
Published
Polar API integration for OpenCode - manage products, customers, and orders
Maintainers
Readme
@opencode/polar
Polar API integration for OpenCode, enabling management of products, customers, and orders through the Polar platform.
Installation
npm install @opencode/polarSetup
- Get your Polar API token from Polar Dashboard
- Find your Organization ID in your Polar settings
- Set your credentials as environment variables:
export POLAR_TOKEN=polar_oat_your_token_here
export POLAR_ORG_ID=your_organization_id_hereOr create a .env file:
cp .env.example .env
# Edit .env and add your credentialsAvailable Tools
polar-get-all-products
Get all products from your Polar organization.
Example:
{}polar-get-product
Get detailed information about a specific product.
Example:
{
id: "prod_123abc"
}polar-get-all-organizations
Get all organizations accessible with your token.
Example:
{}polar-get-all-customers
Get all customers from your Polar organization.
Example:
{}polar-get-all-orders
Get all orders from your Polar organization.
Example:
{}Features
- ✅ Full Polar SDK integration
- ✅ Automatic pagination handling
- ✅ Type-safe responses
- ✅ Comprehensive error handling
- ✅ Environment-based configuration
Response Format
All tools return formatted JSON strings:
[
{
"id": "prod_123",
"name": "Product Name",
"description": "Product description",
"prices": [...],
"created_at": "2024-01-01T00:00:00Z"
}
]Dependencies
@polar-sh/sdk- Official Polar SDKdotenv- Environment variable management
License
MIT
