Playbasis

Python SDK

Automate seeding, migrations, and backend orchestration with the lightweight Python client.

Installation

pip install playbasis-sdk

With Poetry:

poetry add playbasis-sdk

Usage

from playbasis_sdk import PlaybasisClient

client = PlaybasisClient(
    base_url="https://api.example.com/v1",
    api_key=os.environ.get("PLAYBASIS_API_KEY", ""),
)

leaderboard = client.leaderboards.get("points:points", limit=10)
for entry in leaderboard.entries:
    print(entry.player_id, entry.score)

Webhook verification

from playbasis_sdk.security import verify_hmac_signature

is_valid = verify_hmac_signature(
    shared_secret=os.environ["PLAYBASIS_WEBHOOK_SECRET"],
    payload=body,
    signature_header=headers["x-playbasis-signature"],
)

CLI helpers

Use the SDK alongside seed-live-sandbox.mjs scripts to hydrate demo tenants. For infra automation, pair it with Airflow or Azure Functions.

Resources