Quick start
From a new account to your first decision.
1. Get your keys
Create an account, or call POST /v1/signup. Sandbox keys work right away; live keys need a plan.
| Key | Looks like | Use it |
|---|---|---|
| Site key | pk_live_... | In your page. Safe to expose: it can only submit device data. Rotating the secret key leaves it unchanged. |
| Secret key | sk_live_... | On your server only, as Authorization: Bearer sk_live_.... Shown once; only a hash is stored. |
| Test keys | pk_test_..., sk_test_... | The sandbox: no quota, nothing stored, fixed outcomes. |
curl -X POST https://signetsentry.com/v1/signup -H "Content-Type: application/json" -H "Origin: https://signetsentry.com" \
-d '{"name":"My Shop","email":"you@example.com"}'
# -> public_site_key (pk_live_...), secret_api_key (sk_live_...), test_keys { pk_test_..., sk_test_... }
POST /v1/signup needs an Origin header naming this host, as in the example: a browser sends it by itself, and a script sends it as shown. Without it the call answers 403 csrf_check_failed.
Lost a secret key, or think it leaked? Rotate it in your dashboard, under API keys, Rotate keys. The new key shows once. Choose how long the old one keeps working, from not at all up to 7 days, so your servers can switch over before it stops. Your site key stays the same.
2. Add the tag
<script async src="https://signetsentry.com/v1/tag.js" data-site-key="pk_live_..."></script>
<form data-signet action="/pay" method="post">
<input name="email" type="email">
<button>Pay</button>
</form>
Every form[data-signet] gets a hidden signet_session_id field, including forms added later. The tag gathers device signals. It never reads what is typed.
Tell your visitors that you use device-based fraud prevention, and get consent first where the law requires it. See Privacy and deletion.
| Tag option | Effect |
|---|---|
data-site-key | Your site key. Required. |
data-api | Another API origin. |
data-auto="false" | Wait for Signet.collect(). |
data-token="off", data-token="durable" | Identification options. See Identification. |
data-storage="ephemeral" | For a page that must keep nothing. See Identification. |
data-signet-trap on a form | A form trap. |
data-consent="required", data-respect-gpc="true" | Consent mode. |
data-biometrics="true" | Behavioral signals. |
data-ext="off", data-realm="off" | Turn off optional checks. Some smart signals are then null. |
data-test-outcome | Sandbox only. |
3. Send the session ID to your server
A form post carries it already. For fetch calls and single-page apps, ask the tag:
const sessionId = await Signet.getSessionId();
await fetch("/api/checkout", { method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ sessionId, email }) });
A session ID can be assessed for 24 hours, more than once.
Bind the session to the visitor
A session ID is a bearer value: anyone who copies one can send it. These codes catch that.
| Reason code | When |
|---|---|
SESSION_IP_MISMATCH, SESSION_USER_AGENT_MISMATCH | The ip or user_agent you pass differs from the browser that created the session. Behind a proxy, pass the forwarded client IP. Leave them out and nothing is compared. |
SESSION_REUSED_ACROSS_ACCOUNTS | The session was assessed for a second account_id or email. |
COLLECT_CHALLENGE_FAILED | A replayed or altered tag payload. It is refused; there is nothing to configure. |
4. Ask for a decision
Call POST /v1/assess from your server.
Nothing to download.
curl -X POST https://signetsentry.com/v1/assess \
-H "Authorization: Bearer $SIGNET_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"session_id":"s_...","event":"checkout","email":"buyer@example.com","amount":49.90,"currency":"USD",
"ip":"203.0.113.7","user_agent":"Mozilla/5.0 ..."}'
Download the server SDKs and copy node/index.js into your project as signet.js.
const { Signet } = require("./signet");
const signet = new Signet({ secretKey: process.env.SIGNET_SECRET_KEY, timeoutMs: 3000 });
// app is your express app
app.post("/pay", async (req, res) => {
let v;
try {
v = await signet.assess({ sessionId: req.body.signet_session_id, event: "checkout", email: req.body.email,
amount: 49.9, currency: "USD", ip: req.ip, userAgent: req.get("user-agent") });
} catch (e) {
console.error(e); // no answer: log it and let checkout continue
return res.send("Order placed");
}
if (v.decision === "deny") return res.status(402).send("Payment declined");
if (v.decision === "review") return res.send("Order on hold");
res.send("Order placed");
});
Download the server SDKs and copy python/signet.py into your project.
import os
from signet import Signet, SignetError
signet = Signet(os.environ["SIGNET_SECRET_KEY"], timeout=3.0)
try:
v = signet.assess(session_id=form["signet_session_id"], event="checkout", email=form["email"],
amount=49.90, currency="USD", ip=client_ip, user_agent=headers["User-Agent"])
decision = v["decision"] # "allow" | "review" | "deny"
except SignetError as e:
log.warning("Signet: %s", e) # no answer: let checkout continue
decision = "allow"
Download the server SDKs and copy php/src/Signet.php into your project.
require 'Signet.php';
$signet = new \Signet\Client(getenv('SIGNET_SECRET_KEY'), 'https://signetsentry.com', null, 3.0);
try {
$v = $signet->assess($_POST['signet_session_id'], [
'event' => 'checkout', 'email' => $_POST['email'], 'amount' => 49.90, 'currency' => 'USD',
'ip' => $_SERVER['REMOTE_ADDR'], 'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? null,
]);
$decision = $v['decision']; // "allow" | "review" | "deny"
} catch (\Signet\SignetException $e) {
error_log($e->getMessage()); // no answer: let checkout continue
$decision = 'allow';
}
Plain HttpClient. The ASP.NET sample has a typed client, SignetClient, that wraps this call.
using var http = new HttpClient { BaseAddress = new Uri("https://signetsentry.com"), Timeout = TimeSpan.FromSeconds(3) };
http.DefaultRequestHeaders.Authorization = new("Bearer", Environment.GetEnvironmentVariable("SIGNET_SECRET_KEY"));
var res = await http.PostAsJsonAsync("/v1/assess", new
{
session_id = sessionId, @event = "checkout", email, amount = 49.90m, currency = "USD",
ip = ctx.Connection.RemoteIpAddress?.ToString(), user_agent = ctx.Request.Headers.UserAgent.ToString(),
});
res.EnsureSuccessStatusCode();
var verdict = await res.Content.ReadFromJsonAsync<JsonElement>();
var decision = verdict.GetProperty("decision").GetString(); // "allow" | "review" | "deny"
No package to install yet: each SDK is a single file with no dependencies.
| Field | Meaning |
|---|---|
session_id | Required. The session ID from step 3. |
event | checkout, login, signup, password_reset, details_change or pageview. |
account_id or email | The account. An email becomes a pseudonymous account ID and is never stored in the clear. |
ip, user_agent | The visitor’s, as your server saw them. Recommended: they bind the session. |
amount, currency | The payment. Used in reports and Dispute Evidence. |
payment_hash, transaction_id | Your card hash and order reference, for Promo Guard and Dispute Evidence. |
profile | A scoring profile. |
{
"session_id": "s_...", "visitor_id": "v_...", "event_type": "PAYMENT",
"risk_score": 60, "decision": "review", "action": "review", "profile": "default",
"thresholds": { "review": ..., "deny": ... },
"summary": "Review (score 60): this looks like a new device on an anonymized network.",
"explanation": ["The request came from a datacenter or hosting network.", "..."],
"reason_codes": ["IP_DATACENTER", "IP_VPN", "NEW_DEVICE_AT_PAYMENT"],
"reasons": [{ "code": "IP_DATACENTER", "description": "...", ... }],
"visitor": { "is_new": false, "seen_count": 7, "match_confidence": 0.93, "confidence_level": "high", ... },
"signals": { "ip": {...}, "device": {...}, "behavior": {...} }
}
GET and POST /v1/sessions/{session_id} return the same assessment without action.
5. Act on the decision
| Decision | Meaning | Do this |
|---|---|---|
| allow | Below your review threshold. | Proceed. |
| review | Between your thresholds, or a finding that always needs a look. | Step up: second factor, email link or a manual look. Show summary to the reviewer. |
| deny | At or above your deny threshold, or a finding that always denies, such as a device you labeled fraud. | Block or cancel. Log the reason_codes. |
Branch on reason_codes; for example, always step up on VELOCITY_MANY_ACCOUNTS_PER_DEVICE. Show explanation to your team, not to the customer. More in Understanding decisions.
Sample project
A checkout page and API in ASP.NET Core (.NET 10). Other stacks are on Sample apps.
unzip signet-sample-aspnet.zip && cd signet-sample-aspnet/Signet.Sample.Checkout
dotnet user-secrets set "Signet:PublicKey" "pk_test_..."
dotnet user-secrets set "Signet:SecretKey" "sk_test_..."
dotnet run # then open the printed URL (add ?outcome=review in sandbox mode)
Settings are in appsettings.json (Signet:BaseUrl, Signet:Profile). Secrets come from user secrets or the environment (Signet__SecretKey). Signet.Client is its own project, ready for dotnet pack.