Get started
Quick start
Construct one client per project and reuse it. On every authenticated route, pull the bearer token from the Authorization header and verify it.
1. Create the client
pythonauth.py
import os
from decane import DecaneClient
# Copy the ES256 verification key from your Decane dashboard.
# app_id is checked against the token's project_id.
decane = DecaneClient(
app_id=os.environ["DECANE_APP_ID"],
verification_key=os.environ["DECANE_VERIFICATION_KEY"], # ES256 SPKI PEM
)With a static key, verification is offline: no network call on the hot path.
2. Verify the token
pythonmiddleware.py
from decane import DecaneAuthError
token = request.headers.get("Authorization", "").removeprefix("Bearer ")
try:
claims = decane.verify_access_token(token)
except DecaneAuthError:
... # answer 401
claims.user_id # stable Decane user id: key your records off this3. Get the wallet addresses
python
user = decane.get_user(token)
user.addresses.evm # "0x…" or None
user.addresses.solana
user.addresses.tronThat is the whole integration for a backend that only needs to know who is calling. Read on for sign-in, records and server-side wallets.