Lightweight, unbundled event routing and webhook fan-out SDK. Route analytics events and identity traits to your databases, webhooks, Slack, and third-party tools with sub-15ms latency—without paying Twilio Segment's $120–$1,000+/mo MTU tax.
- Zero Price Cliff: Predictable, high-volume event ingestion.
- Sub-15ms Edge Latency: Direct asynchronous routing.
- Drop-in Concept: Familiar
track()andidentify()API signatures. - Both Sync & Async: First-class async/await support with
httpx.
pip install segmentlite(Or via uv / poetry / pipenv):
uv add segmentlitefrom segmentlite import SegmentLite
client = SegmentLite(base_url="https://segmentlite-api-dfru.fly.dev")
# Send an event
response = client.track(
event="Signed Up",
user_id="usr_1029",
properties={
"plan": "Pro",
"billing_cycle": "annual",
"mrr": 49.0
}
)
print(response)
# {'success': True, 'event_id': 'evt_7f1c93a4bc12', 'destinations_queued': 2, 'message': "..."}
# Identify user traits
client.identify(
user_id="usr_1029",
traits={
"name": "Jane Doe",
"email": "jane@example.com",
"company": "Acme Inc."
}
)import asyncio
from segmentlite import AsyncSegmentLite
async def main():
async with AsyncSegmentLite(base_url="https://segmentlite-api-dfru.fly.dev") as client:
res = await client.track(
event="Feature Used",
user_id="usr_1029",
properties={"feature_name": "ai_copilot", "tokens_spent": 420}
)
print("Dispatched:", res)
asyncio.run(main())If you consume SegmentLite via the RapidAPI Hub marketplace subscription:
from segmentlite import SegmentLite
client = SegmentLite(
base_url="https://segmentlite-api.p.rapidapi.com",
rapidapi_key="YOUR_RAPIDAPI_KEY",
rapidapi_host="segmentlite-api.p.rapidapi.com"
)
client.track(event="Order Created", user_id="cust_55", properties={"amount": 129.00})Configure where your ingested events get forwarded in real time:
# Add a webhook destination with optional event filtering
client.add_destination(
name="Internal Analytics Relay",
url="https://api.myapp.com/webhooks/segmentlite",
events_filter=["Signed Up", "Checkout Completed"] # Forward only critical conversion events
)
# List configured destinations
destinations = client.list_destinations()
# Delete a destination
client.delete_destination("dest_12345")- Interactive API Docs / Swagger: https://segmentlite-api-dfru.fly.dev/docs
- Comparison & Calculator: https://segmentlite-api-dfru.fly.dev/compare/segment