CRYTIFY API

Dokumentasi Developer

Crytify punya dua endpoint utama: IP intelligence untuk konteks jaringan mentah, dan request trust untuk keputusan ALLOW, CHALLENGE, atau BLOCK.

Baru pertama kali di sini?

Panduan langkah demi langkah — dari daftar sampai live

Panduan untuk setiap platform (PHP, WordPress, Python, Node.js).

Buka Panduan →

Mulai cepat

  1. Buat akun di https://crytify.com/register dan buka dashboard.
  2. Buka Dashboard > Integration dan buat API key.
  3. Buka Dashboard > Protection dan pilih Easy, Medium, atau Hard.
  4. Download crytify.php dan require sebelum me-render halaman yang dilindungi.
  5. Biarkan Crytify menangani redirect ALLOW, BLOCK, dan hosted CHALLENGE.

INSTALL SATU FILE PHP

Lindungi halaman PHP apapun dengan satu require.

Download file drop-in Crytify, taruh di sebelah halaman yang dilindungi, lalu panggil crytify_gate() sebelum ada output HTML apapun.

Download crytify.php

1. Download

curl -o crytify.php "https://crytify.com/download/crytify.php"

2. Tambahkan ke index.php

<?php
require_once __DIR__ . '/crytify.php';

crytify_gate('cry_live_xxxxxxxxxxxx');

// Your existing page starts here.
?>
Kalau Crytify mengembalikan CHALLENGE, file ini otomatis meredirect visitor ke halaman challenge yang di-hosting Crytify. Setelah verifikasi, visitor kembali ke halaman semula dan file ini mengirim challenge token balik ke Crytify. Di production, kamu bisa hilangkan argumen key dan pakai CRYTIFY_API_KEY di env server.

OPSIONAL

Baca data visitor dari $_SESSION.

crytify_gate() sudah otomatis menyimpan data jaringan dan device visitor di $_SESSION['crytify'] — ga perlu panggil apa-apa lagi buat itu. Kalau kamu lebih suka baca variabel datar seperti $_SESSION['country'] langsung, panggil crytify_populate_session() sekali, di manapun setelah crytify_gate(). Ini sengaja opt-in: key datar-nya pakai nama umum (country, city, timezone...) yang bisa bentrok sama session variable yang udah dipakai app kamu buat hal lain, jadi ga ada yang ditulis kecuali kamu minta.

Penggunaan

<?php
session_start();
require_once __DIR__ . '/crytify.php';
crytify_gate('cry_live_xxxxxxxxxxxx');
crytify_populate_session(); // optional

echo $_SESSION['country'];       // "Indonesia"
echo $_SESSION['isp'];           // "PT. Cyberindo Aditama"
echo $_SESSION['browser_name'];  // "Chrome"
?>

Key yang tersedia

asnisp organizationcountry countryCodecontinent regioncity timezoneutcOffset latlon browser_namebrowser_version os_nameos_version getDeviceNamegetBrandName getModeldetailsdevice

OPSIONAL

Catat setiap visitor dengan on_result.

crytify_populate_session() cuma ngisi $_SESSION pas ALLOW — hasil CHALLENGE atau BLOCK me-render halamannya sendiri dan langsung exit, jadi kode apapun yang kamu taruh setelah crytify_gate() ga pernah jalan buat visitor itu. Kalau kamu mau catat setiap percobaan — bukan cuma yang lolos — kirim callback on_result di options array. Ini jalan buat ketiga keputusan, tepat sebelum halaman challenge/block ditampilkan (atau sebelum halaman render normal, pas ALLOW).

Penggunaan

<?php
require_once __DIR__ . '/crytify.php';

crytify_gate('cry_live_xxxxxxxxxxxx', [
    'on_result' => function (
        string $decision,
        array $network,
        array $device
    ) {
        $line = date('Y-m-d H:i:s') . " | {$decision} | "
            . ($network['country'] ?? '-') . ' | '
            . ($network['isp'] ?? '-') . ' | '
            . ($device['browser_name'] ?? '-') . "\n";
        file_put_contents(
            __DIR__ . '/visitors.txt',
            $line,
            FILE_APPEND | LOCK_EX
        );
    },
]);
?>

Catatan

  • Dipanggil dengan ($decision, $network, $device, $result) — bentuknya sama kayak $_SESSION['crytify'], plus raw response API sebagai argumen ke-4.
  • Visitor yang masih dalam grace period 30 menit pass-cookie skip API call sepenuhnya, jadi on_result ga jalan buat request itu — ga ada yang baru buat dicatat, visitor yang sama kayak terakhir kali.
  • Kalau callback kamu throw error, itu ditangkap dan diabaikan — bug logging ga akan pernah nge-block atau ngerusak gate asli buat visitor beneran.

HEMAT KREDIT

Lindungi halaman tambahan gratis dengan crytify_require_pass().

Setiap panggilan crytify_gate() penuh makan kredit, karena dia jalanin pipeline deteksi beneran. Kalau situs kamu punya satu halaman "pintu depan" yang jelas — landing page, halaman login, halaman produk — yang selalu dilewatin visitor beneran sebelum sampai ke halaman terlindungi lain (checkout, akun, area member), kamu ga perlu jalanin pengecekan penuh di setiap satu halaman itu. crytify_gate() udah otomatis set cookie _crytify_pass yang ditandatangani selama 30 menit setelah ALLOW. crytify_require_pass() itu pengecekan ringan, zero-credit, buat halaman-halaman lain itu: cuma baca cookie itu — ga ada API call, ga ada pipeline deteksi, ga ada biaya.

Kalau cookie-nya hilang atau expired (visitor skip halaman pintu depan sepenuhnya — tanda umum bot/scraper, karena browsing beneran datang lewat jalur klik, bukan hit langsung yang dingin), visitor diarahkan ke halaman entry yang kamu tentukan, dengan parameter return-to, jadi mereka balik ke halaman asli tepat setelah lolos pengecekan beneran di situ. Ini tetap muncul di Live Traffic (sebagai event log ringan, bukan keputusan trust penuh) jadi polanya ga invisible — cuma ga pernah kena biaya kredit.

Halaman entry (dicek normal)

<?php
require_once __DIR__ . '/crytify.php';
crytify_gate('cry_live_xxxxxxxxxxxx');

// Page renders normally. On ALLOW, the
// _crytify_pass cookie is set automatically.
?>

Halaman terlindungi lain (gratis)

<?php
require_once __DIR__ . '/crytify.php';
crytify_require_pass(
    'cry_live_xxxxxxxxxxxx',
    'https://yoursite.com/entry.php'
);

// Reached only if the cookie was valid —
// zero credits charged either way.
?>
Pakai ini cuma buat halaman yang selalu dicapai visitor beneran setelah halaman entry kamu dalam pemakaian normal. Kalau sebuah halaman secara legitimate bisa jadi halaman pertama yang didatangi orang (dari iklan, bookmark, link yang dibagikan tanpa kunjungan sebelumnya), tetap pakai crytify_gate() penuh di situ — kalau ga, setiap kunjungan langsung yang legitimate itu bakal kena redirect tambahan.

CUSTOM CHALLENGE

Sesuaikan brand halaman challenge dari dashboard.

Di Dashboard > Protection, pilih Custom HTML kalau kamu mau halaman challenge cocok sama brand klien. Crytify tetap yang pegang token, CSRF, expiry, submit action, dan alur redirect.

Placeholder yang wajib ada

{{challenge_action}} Form action yang wajib ada.
{{csrf_field}} Field CSRF tersembunyi yang wajib ada.
{{challenge_submit_button}} Tombol Continue yang aman, wajib ada.
{{challenge_message}} Pesan untuk visitor, disarankan.
{{challenge_error}} Tampilan error, disarankan.

HTML minimal yang valid

<div class="challenge-box">
  <h1>Verify before continuing</h1>
  <p>{{challenge_message}}</p>
  {{challenge_error}}
  <form method="post" action="{{challenge_action}}">
    {{csrf_field}}
    {{challenge_submit_button}}
  </form>
</div>
POST /v1/ip

IP Intelligence

Mengembalikan intelijen jaringan yang sudah dinormalisasi. Endpoint ini ga pernah mengembalikan ALLOW, CHALLENGE, atau BLOCK.

{
  "ip": "8.8.8.8"
}
POST /v1/trust

Trust Decision

Mengevaluasi konteks request dan mengembalikan keputusan trust secara sinkron dengan kategori alasan publik yang luas.

{
  "ip": "203.0.113.5",
  "method": "POST",
  "path": "/login",
  "mode": "medium",
  "headers": {
    "user-agent": "Mozilla/5.0 ...",
    "accept": "text/html"
  }
}

Autentikasi

Kirim API key kamu di setiap request. Key yang invalid atau ga sah ga pernah kena charge.

Kredit

IP lookup biayanya 1 kredit. Trust decision biayanya 2, 4, atau 8 kredit untuk mode easy, medium, atau hard.

Sanitasi

Header sensitif seperti cookies, authorization, token, secret, dan password ga disimpan mentah.

INDEKS GEJALA ERROR

Perbaikan middleware dan keamanan pre-render

Developer sering nyari gejala kegagalan middleware mentah, status code, dan gejala pre-render. Catatan ini memetakan gejala infrastruktur umum ke pola request trust yang aman.

Next.js middleware timeout before render

Middleware waits on a remote trust check and the protected route renders slowly or times out.

Move the trust call to a fast server-side gate, enforce a short timeout, and fail open or fail closed based on page sensitivity. Crytify returns a compact ALLOW, CHALLENGE, or BLOCK decision for pre-render enforcement.

  1. Read the client IP and sanitized request headers in middleware or route handler code.
  2. Call POST /v1/trust with the route path and selected protection mode.
  3. Use a short timeout and return a local fallback when the network is unavailable.
  4. Apply the decision before rendering protected content.

403 Forbidden pre-render bypass

A route returns 403 inconsistently, or protected content flashes before the challenge decision is applied.

Run the trust decision before the page body is generated. For client-side gates, hide protected content until the server confirms ALLOW or CHALLENGE.

  1. Move trust enforcement before HTML generation or initial content reveal.
  2. Avoid relying on client-only checks for sensitive pages.
  3. Return BLOCK as 403, CHALLENGE as a verification step, and ALLOW as normal rendering.
  4. Log the request ID for dashboard investigation.

Express rate limit false positive login

Legitimate users are blocked because IP-only rate limits treat shared networks as one actor.

Combine rate limits with a request trust decision instead of blocking solely by IP count. Crytify adds context and returns a decision your app can enforce.

  1. Keep coarse rate limits for obvious floods.
  2. Send high-risk login attempts to /v1/trust with medium or hard mode.
  3. Challenge uncertain requests instead of blocking every shared-network user.
  4. Review broad reason categories in the dashboard.

Cloudflare Worker fetch timeout auth gate

An edge worker fetches an external API and delays authentication or checkout routes.

Use a small request body, colocate the trust call near the edge where possible, and enforce a strict timeout strategy. Crytify responses are compact for edge middleware.

  1. Send only required request context to /v1/trust.
  2. Use AbortController to cap latency.
  3. Cache static assets separately from protected routes.
  4. Fail according to endpoint sensitivity when the trust API is unavailable.

Laravel middleware returns 419 or 403 during bot protection

Security middleware conflicts with CSRF/session handling or blocks before the app can render an error page.

Separate CSRF/session errors from request trust decisions. Run Crytify as a pre-render gate and map ALLOW, CHALLENGE, and BLOCK to predictable app responses.

  1. Validate session and CSRF separately from trust checks.
  2. Call /v1/trust only after the request is structurally valid.
  3. Return a verification page for CHALLENGE and 403 for BLOCK.
  4. Do not expose internal evidence details in public errors.

nginx auth_request 403 loop

A reverse proxy or auth subrequest repeatedly redirects or returns 403 for protected paths.

Keep the edge auth decision stateless, exempt the challenge route from the protected location, and pass only normalized context to the trust API.

  1. Exclude challenge and static asset routes from the protected gate.
  2. Forward normalized IP and path metadata to the application gate.
  3. Apply Crytify decisions once per protected request.
  4. Record the request ID for debugging.

Base URL

https://api.crytify.com

Autentikasi

Kirim API key kamu di setiap request API pakai format Bearer token. Ini kerjanya sama terlepas dari HTTP method-nya — /v1/ip dan /v1/trust itu POST, sedangkan /v1/usage dan /v1/me itu GET.

curl -X POST "https://api.crytify.com/v1/trust" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cry_live_xxxxxxxxxxxx" \
  -d '{ ... }'

IP Lookup

Pakai /v1/ip kalau kamu cuma butuh intelijen jaringan. Biayanya 1 kredit dan ga mengembalikan keputusan trust.

curl -X POST "https://api.crytify.com/v1/ip" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cry_live_xxxxxxxxxxxx" \
  -d '{
    "ip": "8.8.8.8"
  }'
{
  "request_id": "req_123",
  "ip": "8.8.8.8",
  "network": {
    "country": "US",
    "network_type": "business"
  },
  "credits": {
    "charged": 1,
    "remaining_today": 999
  }
}

BIN Lookup

Gratis · Ga perlu API key

Cari tahu jaringan kartu, tipe, bank penerbit, dan negara dari 6–8 digit pertama kartu pembayaran apapun (BIN/IIN). Ga perlu autentikasi — dibatasi 10 request per menit per IP.

curl "https://api.crytify.com/api/bin/453201"
{
  "bin": "453201",
  "scheme": "Visa",
  "type": "Debit",
  "brand": "Visa Classic",
  "prepaid": false,
  "bank": {
    "name": "Jyske Bank",
    "city": "Silkeborg",
    "phone": "+4589893300"
  },
  "country": {
    "name": "Denmark",
    "code": "DK",
    "emoji": "🇩🇰",
    "currency": "DKK"
  }
}
FieldDeskripsi
bin BIN yang kamu query (6–8 digit).
scheme Jaringan kartu: Visa, Mastercard, Amex, dll.
type Credit, Debit, atau Prepaid.
brand Sub-brand (misalnya Visa Classic, Mastercard Gold).
prepaid true kalau kartunya prepaid.
bank.name Nama bank penerbit.
country.code Kode negara ISO 3166-1 alpha-2.
country.currency Kode mata uang ISO 4217.

Mengembalikan HTTP 404 kalau BIN ga ada di database. Mengembalikan HTTP 429 kalau rate limit terlampaui — tunggu dan coba lagi setelah 60 detik.

Trust Decision

Pakai /v1/trust sebelum me-render konten yang dilindungi. Kirim IP, method, path, dan header browser yang sudah disanitasi. Opsional: sertakan objek fingerprint dari JavaScript SDK buat memperbaiki analisis konsistensi request. ↳ JavaScript SDK

curl -X POST "https://api.crytify.com/v1/trust" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cry_live_xxxxxxxxxxxx" \
  -d '{
    "ip": "203.0.113.5",
    "mode": "hard",
    "method": "POST",
    "path": "/login",
    "url": "https://app.example.com/login",
    "challenge_return_url": "https://app.example.com/login",
    "headers": {
      "user-agent": "Mozilla/5.0 ...",
      "accept": "text/html,application/xhtml+xml",
      "accept-language": "en-US,en;q=0.9",
      "sec-ch-ua-platform": "\"Windows\""
    },
    "fingerprint": {
      "client_context": "generated by the Crytify JavaScript SDK"
    }
  }'
{
  "request_id": "req_456",
  "decision": "CHALLENGE",
  "mode": "hard",
  "trust_score": 42,
  "risk_score": 61,
  "reasons": [
    "identity_risk"
  ],
  "challenge": {
    "type": "hosted",
    "url": "https://crytify.com/challenge/abc123",
    "expires_in": 600,
    "token_param": "crytify_challenge_token"
  },
  "network": {
    "country": "US",
    "network_type": "unknown"
  },
  "credits": {
    "charged": 8,
    "remaining_today": 992
  }
}

Alur hosted challenge

Kalau keputusannya CHALLENGE, redirect visitor ke challenge.url. Setelah verifikasi, Crytify redirect balik ke challenge_return_url dengan crytify_challenge_token. Kirim nilai itu sebagai challenge_token di panggilan /v1/trust berikutnya.

Mode test

Tambahkan "test": true ke body request pas kamu lagi eksplorasi alur integrasi. Decision engine beneran tetap jalan — ALLOW/CHALLENGE/BLOCK yang sama kayak yang bakal kamu dapat di production — tapi ga ada apapun dari request itu yang ditulis balik ke data self-learning Crytify (reputasi IP, ASN, atau fingerprint). Kredit tetap kena charge normal, dan request-nya tetap muncul di dashboard kamu ditandai sebagai test request.

Jangan pernah kirim test: true dari traffic visitor beneran — itu cuma buat testing eksplorasi/integrasi kamu sendiri. Testing berulang tanpa itu (misal lewat curl, dari IP yang sama, berkali-kali) bisa numpuk reputasi self-learned beneran ke IP kamu sendiri, persis kayak traffic lain manapun.

Testing langsung di situs kamu sendiri pakai crytify_gate()? Kirim di options array-nya, ga usah edit body request sendiri:

crytify_gate('cry_live_xxxxxxxxxxxx', ['test' => true]);

Usage

GET · Gratis — ga makan kredit

Cek sisa kredit harian dan limit paket buat akun key yang terautentikasi. Berguna buat nampilin usage di dashboard kamu sendiri atau kasih peringatan sebelum habis.

curl "https://api.crytify.com/v1/usage" \
  -H "Authorization: Bearer cry_live_xxxxxxxxxxxx"
{
  "user_id": 7,
  "plan": "free",
  "credits": {
    "daily_limit": 1000,
    "daily_used": 42,
    "daily_remaining": 958,
    "unlimited": false,
    "balance": 0,
    "reset_at": "2026-07-04T00:00:00Z"
  }
}

Me

GET · Gratis — ga makan kredit

Mengembalikan metadata soal API key yang dipakai dan paket akun saat ini. Berguna buat verifikasi key/mode mana yang aktif tanpa buka dashboard.

curl "https://api.crytify.com/v1/me" \
  -H "Authorization: Bearer cry_live_xxxxxxxxxxxx"
{
  "api_key": {
    "id": 22,
    "name": "Default Key",
    "prefix": "cry_live_b6ba5ef81c422782",
    "default_mode": "medium",
    "can_override_mode": false,
    "status": "active",
    "created_at": "2026-07-03 01:05:42"
  },
  "account": {
    "id": 7,
    "plan": "free"
  }
}

Mode dan Kredit

Mode Kredit Kasus pakai
easy2Halaman konten dengan friksi rendah.
medium4Mode default buat form, halaman akun, dan perlindungan umum.
hard8Login, signup, checkout, admin, dan perlindungan API.

Header yang Direkomendasikan

Kirim header browser yang berguna, tapi jangan kirim cookies mentah, token authorization, password, atau secret.

user-agent
accept
accept-language
accept-encoding
sec-fetch-site
sec-fetch-mode
sec-fetch-dest
sec-ch-ua
sec-ch-ua-mobile
sec-ch-ua-platform

Kode Error

KodeHTTPArti
invalid_json 400 Body request bukan JSON yang valid.
missing_required_field 400 Field wajib seperti ip hilang.
invalid_ip 400 Alamat IP yang dikirim ga valid.
invalid_api_key 401 API key hilang atau ga valid.
insufficient_credits 402 Wallet ga punya cukup kredit.
rate_limited 429 Terlalu banyak request.
internal_error 500 Error internal. Kredit yang kena charge di-refund.

Contoh Penerapan

Aplikasi kamu yang nentuin mau ngapain sama keputusan yang dikembalikan. Gate pre-render yang tipikal kira-kira begini:

if ($decision === 'BLOCK') {
    http_response_code(403);
    exit('Blocked');
}

if ($decision === 'CHALLENGE') {
    header('Location: ' . $result['challenge']['url']);
    exit;
}

if (!empty($_GET['crytify_challenge_token'])) {
    // Send this token in the next /v1/trust call as challenge_token.
}

renderProtectedPage();

Perlindungan Halaman

SDK · Gate dua lapis

SDK Crytify bikin kamu bisa nyembunyiin konten halaman dari bot sebelum sempat dirender atau kelihatan. Ada dua lapis yang saling melengkapi — pakai keduanya bareng buat cakupan maksimal.

1

Gate server-side (PHP)

Evaluasi IP dan header visitor di kode PHP kamu sebelum render apapun. Memblokir semua bot — termasuk yang ga jalanin JavaScript (curl, Python requests, Scrapy, wget).

2

Gate client-side (JS)

Script di <head> langsung nyembunyiin halaman, ngumpulin metadata konsistensi, dan cuma nampilin konten setelah pengecekan trust lolos.

BrowserYour serverCrytify /v1/trust
               ↓ gate PHP (sebelum render)

Browsercrytify-protect.jsYour endpointCrytify /v1/trust
                                  ↓ gate JS (sebelum kelihatan)

Cuma halaman entry kamu yang butuh pengecekan penuh. Kalau visitor selalu sampai ke halaman terlindungi lain (checkout, akun) setelah halaman yang udah jalanin crytify_gate(), pakai crytify_require_pass() di situ — pengecekan gratis berbasis cookie doang, ga ada API call dan ga kena kredit. Lihat cara kerjanya →

JavaScript SDK

crytify-protect.js itu script drop-in yang langsung nyembunyiin halaman kamu pas load, ngumpulin fingerprint browser, dan ngirim ke backend kamu. Konten cuma ditampilin setelah backend kamu konfirmasi visitor-nya diizinkan.

1. Pasang di <head> — sebelum script lain manapun

<head>
  <!-- Must be the first script in <head> -->
  <script src="/crytify-protect.js"
          data-endpoint="/api/crytify-check"
          data-block-url="/blocked"
          data-timeout="5000">
  </script>
</head>

Opsi

Atribut Wajib Deskripsi
data-endpoint Ya URL endpoint pengecekan trust backend kamu. JS-nya bakal POST fingerprint ke sini.
data-block-url Tidak Redirect ke sini kalau visitor diblokir. Default-nya pesan blokir inline.
data-timeout Tidak Milidetik sebelum fail open (tetap nampilin konten) kalau endpoint kamu ga merespons. Default: 5000.
data-debug Tidak Set ke "true" buat nampilin log keputusan di console browser.

2. Buat endpoint backend (data-endpoint)

JS-nya nge-POST { "fingerprint": { ... } } ke endpoint kamu. Endpoint kamu manggil Crytify dan mengembalikan { "allow": true } atau { "allow": false }.

<?php
// /api/crytify-check.php — the endpoint crytify-protect.js calls

require 'CrytifyClient.php';

header('Content-Type: application/json');

$body        = json_decode(file_get_contents('php://input'), true);
$fingerprint = $body['fingerprint'] ?? null;

$crytify = new CrytifyClient('cry_live_xxxxxxxxxxxx');
$result  = $crytify->trust(
    CrytifyClient::resolveIp(),
    getallheaders(),
    ['fingerprint' => $fingerprint]
);

echo json_encode(['allow' => $result->isAllow(), 'reason' => $result->reason()]);
Keamanan fail-open: Kalau endpoint kamu ga bisa dijangkau atau lebih lama dari data-timeout milidetik, script-nya otomatis nampilin halamannya. Ini nyegah outage Crytify ngerusak situs kamu buat user beneran.

PHP SDK

CrytifyClient.php itu class PHP mandiri tanpa dependency. Taruh di manapun di project kamu. Pakai sebagai middleware buat nge-gate render halaman sebelum satu byte HTML pun terkirim.

Download

# Copy the file into your project
cp crytify-sdk/CrytifyClient.php your-project/lib/CrytifyClient.php

Penggunaan dasar — gate server-side

Taruh ini di paling atas halaman PHP manapun yang mau kamu lindungi, sebelum ada output apapun.

<?php
require 'CrytifyClient.php';

$crytify = new CrytifyClient('cry_live_xxxxxxxxxxxx', mode: 'medium');

$result = $crytify->trust(
    CrytifyClient::resolveIp(),   // resolves CF-Connecting-IP / X-Forwarded-For automatically
    getallheaders(),
    ['path' => $_SERVER['REQUEST_URI'], 'method' => $_SERVER['REQUEST_METHOD']]
);

if ($result->isBlock()) {
    http_response_code(403);
    include 'blocked.html';
    exit;
}

if ($result->isChallenge()) {
    header('Location: ' . $result->challengeUrl());
    exit;
}

// Visitor passed — render your page normally

Method CrytifyResult

MethodReturnDeskripsi
isAllow() bool true kalau visitor lolos.
isChallenge() bool true kalau verifikasi tambahan direkomendasikan.
isBlock() bool true kalau visitor harus ditolak.
challengeUrl() ?string URL hosted challenge Crytify kalau keputusannya CHALLENGE.
decision() string String keputusan mentah: ALLOW, CHALLENGE, atau BLOCK.
trustScore() int 0–100. Lebih tinggi berarti lebih dipercaya.
riskScore() int 0–100. Lebih tinggi berarti lebih mencurigakan.
reason() string String alasan yang bisa dibaca manusia dari keputusan itu.
isFailOpen() bool true kalau error jaringan menyebabkan fail-open otomatis.

Filter CodeIgniter 4

Untuk project CI4, pakai class filter yang disediakan buat lindungi route secara deklaratif.

// app/Config/Filters.php
public array $aliases = [
    'crytify' => \App\Filters\CrytifyGateFilter::class,
];

// app/Config/Routes.php — protect individual routes
$routes->get('checkout', 'OrderController::checkout', ['filter' => 'crytify']);

// Or protect an entire group
$routes->group('members', ['filter' => 'crytify'], function ($routes) {
    $routes->get('dashboard', 'MemberController::dashboard');
    $routes->get('profile',   'MemberController::profile');
});

Browser Fingerprint

Ngirim objek fingerprint di /v1/trust nambahin konteks konsistensi client-side yang ga tersedia dari header server doang. Penanganan sinyal detailnya privat dan respons publik cuma nampilin kategori alasan yang luas.

Kategori publik

SinyalArtinya apaConfidence
fingerprint_risk Konteks konsistensi client-side ikut berkontribusi ke keputusan. kategori publik
automation_risk Konteks terkait automation ikut berkontribusi ke keputusan. kategori publik
identity_risk Konteks konsistensi sesi atau identitas ikut berkontribusi ke keputusan. kategori publik

Kumpulin fingerprint dengan helper JS

crytify-fingerprint.js ngumpulin semua sinyal dan mengembalikan objek biasa. Pakai ini sendiri kalau kamu mau ngumpulin fingerprint sendiri dan ngirimnya ke server kamu tanpa perilaku auto-hide halaman.

<script src="/crytify-fingerprint.js"></script>
<script>
crytifyFingerprint().then(function (fp) {
    // fp is a plain JS object — send it to your server
    fetch('/api/login', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
            email:       document.getElementById('email').value,
            password:    document.getElementById('password').value,
            fingerprint: fp,   // <-- include fingerprint in your form submission
        }),
    });
});
</script>

Server kamu terus ngirim fingerprint langsung ke /v1/trust di body request. Ga perlu endpoint Crytify baru.