1. Set callback for your domain
curl -X POST https://api.shieldlabs.ai/{credendials}/callback \
-H "Content-Type: text/plain" \
-d '{https://your_domain.com/your_callback}'
2. add scrip to to your site
Loading examples...
3. Allow connect-src for shieldlabs.ai
# Nginx example
add_header Content-Security-Policy "
default-src 'self';
script-src 'self' https://shieldlabs.ai;
connect-src 'self' blob: *.shieldlabs.ai wss://*.shieldlabs.ai;
img-src 'self' data: blob:;
style-src 'self' 'unsafe-inline';
font-src 'self';
base-uri 'self';
frame-ancestors 'none'
" always;
4. lisen POST data on your custom webhook address
func Assing(d Data, secret string) Hook {
h := Hook{Data: d}
if secret != "" {
if b, err := json.Marshal(d); err == nil {
mac := hmac.New(sha256.New, []byte(secret))
_, _ = mac.Write(b)
h.Assing = hex.EncodeToString(mac.Sum(nil))
}
}
return h
}
5. after webhook you can get full info about ip
curl -X GET https://api.shieldlabs.ai/{credendials}/history/{ip|user_hid|visitor_id|request_id|device_id}/{value}?limit=100
Load...