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.2.tar.gz (7.0 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.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vact_server-1.0.2.tar.gz
  • Upload date:
  • Size: 7.0 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.2.tar.gz
Algorithm Hash digest
SHA256 d22c9a2d0736aa3852759f57ff699f4841fcebb1eee04bed7b9636742c25d7c4
MD5 c2a14322bb69c1a1043d9e936836560d
BLAKE2b-256 ad400b4b9a5807f386e38a3e3723f3a90eb1430d69bd291a4e2a5bf7dc6cdb53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vact_server-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e0c7504aef355d1a82b6a53ff04c20ea5e214fa22b9ffe296e08fd2af692126
MD5 d4db32694d8650b74d789ecae50fec78
BLAKE2b-256 541af5d27d4187ccbd854dd09fd7155434e4dea7f2ab78602a6552a31ade6f04

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 files

1.0.1

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