Python client for the Bitcaster event notification platform.
Set your Bitcaster API endpoint:
export BITCASTER_BAE=https://<API_KEY>@<SERVER>/api/o/<organization_slug>/
from bitcaster_sdk import Client
client = Client("https://<API_KEY>@<SERVER>/api/o/<organization_slug>/")
client.set_domain("my-project", "my-app")
result = client.trigger_event("order.created", context={"id": "abc-123"})
print(result)
users = client.list_users()
events = client.list_events("my-project", "my-app")
projects = client.list_projects()from bitcaster_sdk import AsyncClient
with AsyncClient("https://<API_KEY>@<SERVER>/api/o/<organization_slug>/") as client:
client.set_domain("my-project", "my-app")
future = client.trigger_event("order.created", context={"id": "abc-123"})
result = future.result(timeout=10)
print(result)The async client runs HTTP requests on a background thread. The context manager ensures clean shutdown.
import bitcaster_sdk
bitcaster_sdk.init() # reads BITCASTER_BAE env var
bitcaster_sdk.set_domain("my-project", "my-app")
result = bitcaster_sdk.trigger_event("order.created")
users = bitcaster_sdk.list_users()# Check connectivity
bitcaster ping
# Trigger an event
bitcaster trigger --project my-project --application my-app event-slug \
--context order_id abc-123
# List resources
bitcaster projects
bitcaster applications --project my-project
bitcaster events --project my-project --application my-app
bitcaster users list
# Start a fake dev server
bitcaster serve --port 9000See the CLI reference for full documentation.