Skip to main content

vact-server

Server-only VACT client for Python. No dependencies — standard library only.

New to VACT? Create a free account at vact.online₹100 of calling credit to build with, no card required. Full guides and API reference: vact.online/docs.html.

pip install vact-server

Your backend is the only place the App Secret ever lives. It authenticates your own user, then asks VACT for a short-lived token scoped to them.

from vact_server import VactServer

vact = VactServer(
    app_id=os.environ["VACT_APP_ID"],
    app_secret=os.environ["VACT_APP_SECRET"],
)

# After YOUR login has decided who this is:
token = vact.create_access_token(
    user_id=current_user.id,
    allowed_callee_ids=["user_42"],   # optional: restrict who they may call
)
return {"accessToken": token["accessToken"]}

Verifying webhooks

Pass the raw request bytes. Re-serializing parsed JSON changes the bytes and the signature will not match.

from vact_server import verify_vact_webhook, VactServerError

@app.post("/webhooks/vact")
async def webhook(request):
    try:
        event = verify_vact_webhook(
            await request.body(),          # raw bytes, not the parsed dict
            dict(request.headers),
            os.environ["VACT_WEBHOOK_SECRET"],
        )
    except VactServerError:
        return Response(status_code=400)   # never process an unverified body

    # Deduplicate on event["eventId"] — delivery is retried.
    if event["type"] == "incoming_call":
        send_push(event["data"]["toUserId"], event["data"])
    return Response(status_code=200)

Signature verification is timing-safe and rejects deliveries whose timestamp is more than five minutes old, which stops replay.

Deleting a user's data

result = vact.delete_user_data(user_id)   # pages internally until complete

Full documentation: https://vact.online/docs.html

Download files

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

Source Distribution

vact_server-1.0.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

vact_server-1.0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file vact_server-1.0.1.tar.gz.

File metadata

  • Download URL: vact_server-1.0.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.6

File hashes

Hashes for vact_server-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e30d5a6f4b85e0ca149986e1363a6eecfc910d50dd94d1aca50dc2d07a4284f8
MD5 b21dfb2e448bd87cde766c01087bb932
BLAKE2b-256 46fd6e36f3cb82603898c21e3f1af08f011a1ebc874953dff9a7a4c83483ffce

See more details on using hashes here.

File details

Details for the file vact_server-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: vact_server-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.6

File hashes

Hashes for vact_server-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1dea53671306349127491240e9ab69e0f61ddde80868910ceb14f0abe244e63c
MD5 b767089986d2dedc5be5ffa90ee9f2c2
BLAKE2b-256 c805f9e4989dbc723a08eb462885f6dc099bf418bbb54e9258b3257e69c79205

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.2

2 files

This release

1.0.1 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page