string
Type of event.
string
Associated event data.
import crypto from "crypto";
function verify(request) {
const supahubNonce = request.headers["X-Supahub-Nonce"];
const supahubSignature = request.headers["X-Supahub-Signature"];
const APIKey = "YOUR_API_KEY";
const calculated = crypto
.createHmac("sha256", APIKey)
.update(supahubNonce)
.digest("base64");
return supahubSignature === calculated;
}
import hmac
import hashlib
import base64
def verify(request):
supahub_nonce = request.headers.get("X-Supahub-Nonce")
supahub_signature = request.headers.get("X-Supahub-Signature")
api_key = "YOUR_API_KEY"
calculated = base64.b64encode(
hmac.new(api_key.encode(), supahub_nonce.encode(), hashlib.sha256).digest()
).decode()
return supahub_signature == calculated