Sparkforge Python and PHP SDKs for the v2 Public API
The official Sparkforge Python and PHP SDKs wrap the v2 Public API and handle OAuth 2.0 token exchange, refresh, and webhook signature validation automatically. Drop them in and skip the auth plumbing.
The official Sparkforge Python and PHP SDKs wrap the entire v2 Public API and handle OAuth 2.0 token work for you. Drop them into your stack and skip the authentication plumbing.
What the SDKs cover
The sparkforge/api-client (PHP) and sparkforge-api-client (Python) libraries automate OAuth 2.0 token exchange, rotation, uninstall cleanup, and marketplace bulk-installs. Every public endpoint is exposed through type-safe helpers.
What you get
- One-line OAuth 2.0 — exchange, store, and refresh tokens behind the scenes.
- Database-agnostic session storage — adapters for Memory, MongoDB, Redis, MySQL, PostgreSQL, and custom backends.
- Webhook helpers — validate signatures and process INSTALL / UNINSTALL events automatically.
- Typed service methods — every public endpoint, with less boilerplate and fewer runtime errors.
- Auto-generated — clients rebuild from the OpenAPI spec on every API release.
Supported OAuth 2.0 flows
- Sub-account installs via the Marketplace Connect button
- Bulk agency installs across all locations
- Future auto-installs when new sub-accounts are created
- Daily silent token refresh before expiry
- Graceful uninstall cleanup
Token storage
Pluggable adapters keep tokens in whatever store you already run:
- In-memory cache for local dev
- MongoDB, Redis, MySQL, PostgreSQL
- Custom class implementing the storage interface
Auto-generation
Both clients regenerate from the OpenAPI spec on every release. Update with a simple composer update or pip install --upgrade.
Resources
- Sparkforge Python SDK and example project
- Sparkforge PHP SDK and example project
Frequently Asked Questions
Do I still need to refresh tokens manually?
Can I store tokens somewhere other than MongoDB?
Does the SDK support Private Integration Tokens?
How do I validate webhook signatures?
Is the SDK compatible with v1 endpoints?
Was this article helpful?
Thanks for the feedback.