Getting your page ready…
Python SDK
Your first signed reply with wayo-agent.
1. Install the SDK
Requires Python 3.10 or newer. The package is named wayo-agent. Use the download until registry publication is complete.
Install from your download folder
# Extract wayo-agent-python.zip first
python -m pip install ./wayo-agent-pythonAfter publication on pip or npm
Only after the package is published
python -m pip install wayo-agent2. Set your signing secret
In Settings → Developers, copy your signing secret. It is required by the SDK, for Chat, Webhook and REST alike.
Windows · PowerShell
$env:WAYO_SECRET="whsec_REPLACE_WITH_YOUR_REAL_SECRET"macOS, Linux, hosting and .env files
macOS / Linux
export WAYO_SECRET="whsec_REPLACE_WITH_YOUR_REAL_SECRET"On your hosting service, add WAYO_SECRET in environment settings. A .env file must be loaded by your application; the SDK does not load it automatically. Start or restart your server after setting the value.
3. Return your first reply
Start with this complete local example. It returns a connection test reply.
standalone.py · Python serve example
from wayo_agent import Wayo
wayo = Wayo.from_env()
wayo.on_message(lambda message: "Wayo is connected.")
if __name__ == "__main__":
wayo.serve(port=8080)Run in the terminal where you set WAYO_SECRET
python standalone.pyReturn plain text or an object containing a nonempty reply. Replace the test reply with your own inventory or business lookup. Register only one handler.
Use the SDK inside an existing route
FastAPI · inside an existing route
from fastapi import Request
from fastapi.responses import JSONResponse
# Register your wayo.on_message handler first.
@app.post("/wayo")
async def wayo_route(request: Request):
status, data = await wayo.handle(
body=await request.body(), headers=request.headers
)
return JSONResponse(data, status_code=status)Pass the original request bytes for signature verification. Do not parse and rebuild the JSON first.
Deploy the Python app with ASGI
Production ASGI entry point
# In app.py, after registering your answer function:
app = wayo.app()
# Install and run from your terminal:
# python -m pip install uvicorn
# python -m uvicorn app:app --port 80804. Connect in Wayo
Deploy behind a public HTTPS address or expose your local server through an HTTPS tunnel. Localhost cannot be used as a Wayo endpoint.
Example public endpoint · replace with your domain
https://your-business.example/Choose Chat API, enter your final endpoint, and press Test connection. Expect “Wayo is connected.” Then replace the test reply with real data and test again before saving.
Connect Chat APIThe same handler accepts Webhook POST and REST GET. See Requests & replies for their formats. Standalone examples are for development; use your usual production hosting for real traffic.