Skip to content

Framework examples

The authenticator is framework-agnostic. Each example follows the same pattern:

  1. Read the authorization value from the incoming request.
  2. Parse and verify launch parameters with get_verified_launch_params().
  3. Treat InvalidInitDataError and None results as authentication failures.
  4. Use the verified vk_user_id in application-specific user lookup logic.
  • FastAPI

    Dependency-based authentication for route handlers.

    FastAPI

  • Django

    Middleware-based authentication for Django views.

    Django

  • Django Ninja

    HttpBearer integration for Ninja API endpoints.

    Django Ninja