Skip to main content

Lightweight internal SDK for tracing Paylink payment operations - automatically logs and sends tool execution data to Paylink API

Project description

Paylink Tracer SDK

Lightweight internal SDK for tracing Paylink payment operations.

🚀 Quick Start

1. Install

uv add paylink-tracer

2. Configure

Set the required environment variables (or use a .env file):

PAYLINK_API_KEY=plk_live_xxxxx
PAYLINK_PROJECT=Demo Project
PAYMENT_PROVIDER=["mpesa"]
PAYLINK_TRACING=enabled

3. Use the Decorator

from paylink_tracer import paylink_tracer

@paylink_tracer
async def call_tool(name: str, arguments: dict):
    # Your payment logic here
    return {"status": "success", "message": "Payment processed"}

# Example call
await call_tool("stk_push", {"amount": "1000", "phone": "254700000000"})

🧠 Notes

  • Automatically sends traces to http://127.0.0.1:8000/api/v1/trace (local dev)
  • Use set_base_url("https://api.paylink.co.ke") for production
  • Works with async functions
  • Automatically captures errors, arguments, and timing
  • Disable tracing with PAYLINK_TRACING=disabled

👨‍💻 Internal Use Only

This SDK is intended for internal Paylink use.
For issues or updates, contact the Paylink engineering team.

📄 License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paylink_tracer-0.1.6.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paylink_tracer-0.1.6-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page