1. Install the package

Install the SDK in your virtual environment.

pip install ashkar-sdk

2. Connect Ashkar to your app

Keep the project's Server key in an environment variable and create one client at startup.

import os
from ashkar import Ashkar

ashkar = Ashkar(
    project_key=os.environ["ASHKAR_SERVER_KEY"],
    endpoint="https://app.ashkarhq.ir",
    environment="production",
    release="api@1.0.0",
)

3. Send a test error

Send a test message and give it a moment to be delivered.

event_id = ashkar.capture_message("Ashkar Python test")
ashkar.flush(timeout=2)
print(event_id)

4. Check the result in Issues

Look for “Ashkar Python test” in the project. Once it appears, use capture_exception around the important parts of your app.