Supabase Integration
useHUMA
+ Supabase.
Protect your Supabase app from bots and fake signups — without CAPTCHAs. A single API call returns a real-time trust score (0–100). No PII stored. Under 200ms.
<200ms
Latency
0 PII
Data stored
5 min
To integrate
HOWHow it works
1.Your frontend collects a behavioral token as the user fills your form.
2.Your backend (Edge Function or Server Action) sends the token to useHUMA.
3.useHUMA returns a trust score in real time — no PII, no biometrics stored.
4.You allow or block the Supabase action based on the score threshold.
01
Get your API keySign up at humaverify.com and grab your API key from the dashboard. 14-day free trial — no credit card required.
HUMA_API_KEY=huma_live_xxxxxxxxxxxxxxxxxxxxxxxxAdd this to your Supabase Edge Function secrets or .env.local.
02
Add the frontend scriptAdd this to your layout.tsx or _app.tsx:
<script src="https://humaverify.com/huma.js"></script>Then collect the behavioral signals on form submit:
const handleSubmit = async (e) => {
e.preventDefault();
// Anonymous behavioral signals — no PII
const signals = window.Huma?.debug().features ?? {};
await signUp({ email, password, signals });
};03
Verify in a Supabase Edge FunctionCreate supabase/functions/verify-human/index.ts:
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts'
serve(async (req) => {
const { signals, email, password } = await req.json()
// Verify with useHUMA
const humaRes = await fetch('https://humaverify.com/api/v1/verify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${Deno.env.get('HUMA_API_KEY')}`,
},
body: JSON.stringify({ userId: email, sessionData: signals }),
})
const { human } = await humaRes.json()
if (!human) {
return new Response(
JSON.stringify({ error: 'Verification failed. Please try again.' }),
{ status: 403, headers: { 'Content-Type': 'application/json' } }
)
}
// Proceed with Supabase signup
const { createClient } = await import('https://esm.sh/@supabase/supabase-js@2')
const supabase = createClient(
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
)
const { data, error } = await supabase.auth.admin.createUser({
email, password, email_confirm: true,
})
if (error) return new Response(
JSON.stringify({ error: error.message }),
{ status: 400, headers: { 'Content-Type': 'application/json' } }
)
return new Response(
JSON.stringify({ user: data.user }),
{ status: 200, headers: { 'Content-Type': 'application/json' } }
)
})04
Alternative — Next.js Server ActionsAdd useHUMA to your app/signup/actions.ts:
'use server'
export async function signUp(formData: FormData) {
const email = formData.get('email') as string
const password = formData.get('password') as string
const signals = JSON.parse((formData.get('huma_signals') as string) ?? '{}')
const humaRes = await fetch('https://humaverify.com/api/v1/verify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.HUMA_API_KEY}`,
},
body: JSON.stringify({ userId: email, sessionData: signals }),
})
const { human } = await humaRes.json()
if (!human) {
return { error: 'Verification failed. Please try again.' }
}
const supabase = createClient()
const { error } = await supabase.auth.signUp({ email, password })
if (error) return { error: error.message }
return { success: true }
}REF
Trust Score Reference75–100High confidence humanAllow
50–74Likely humanAllow + log
25–49SuspiciousAdd friction
0–24High confidence botBlock
Ready to protect your app?
Start your free trial
14-day free trial · No credit card required · Under 5 min to integrate
Get your free API key →