Checkify
เอกสารสำหรับนักพัฒนา

เอกสารอ้างอิง Embed SDK

Browser API สำหรับการยืนยัน Checkify Pass URL ของ CDN: https://checkify.me/sdk/v1/checkify.min.js

ติดตั้ง

<script src="https://checkify.me/sdk/v1/checkify.min.js"></script>

หลังโหลด window.Checkify.version จะรายงานรุ่น SDK (ปัจจุบัน 1.0.4)

HTML ติดตั้งอัตโนมัติ

SDK จะ mount องค์ประกอบที่มีแอตทริบิวต์เหล่านี้โดยอัตโนมัติเมื่อโหลดหน้า:

<div
  data-checkify-pass="YOUR_PASS_ID"
  data-checkify-request="human"
  data-checkify-text="Verify with Checkify"
  data-checkify-return-url="https://yoursite.com/done"
></div>

เลิกใช้แล้ว: data-checkify-launcher ยังใช้งานได้แต่จะแสดงคำเตือนใน console ใช้ Pass + ประเภทคำขอแทน

วิธีการคำอธิบาย
data-checkify-passYour Checkify Pass public ID (required)
data-checkify-requestRequest type: human, age_over_18, age_over_21, age_over_25, or age_over_N
data-checkify-textButton label text
data-checkify-return-urlOptional URL to return to after app handoff
data-checkify-fieldsOptional comma-separated identity fields to request (for example country)
data-checkify-proofsOptional comma-separated proof types when your Pass supports multiple proofs
data-checkify-launcherDeprecated launcher ID — use data-checkify-pass instead

Form integration attributes

When using Checkify.bindForm, you can also set these on the form element:

วิธีการคำอธิบาย
data-checkify-passYour Checkify Pass public ID (required)
data-checkify-requestRequest type: human, age_over_18, age_over_21, age_over_25, or age_over_N
data-checkify-auto="true"Set data-checkify-auto="true" on a form to auto-bind on page load without calling bindForm manually
data-checkify-hidden-inputCSS selector for the hidden input that receives request_id (default: input[name=checkify_token])

Checkify.configure(options)

ตั้งค่าเริ่มต้นทั่วโลกก่อน mount widget

Checkify.configure({
  baseUrl: 'https://checkify.me',
  completeUrl: '/checkify/complete'
});

Checkify.bindForm(form, options)

แสดงปุ่มยืนยัน เขียนโทเค็นลง input ที่ซ่อน และปิดการส่งจนกว่าจะยืนยันแล้ว

Checkify.bindForm('#my-form', {
  passId: 'YOUR_PASS_ID',
  requestType: 'human',
  buttonTarget: '#checkify-wrap',
  submitButton: '#submit',
  hiddenInput: '#checkify_token',
  disableSubmitUntilVerified: true
});

bindForm options

Common options passed as the second argument to Checkify.bindForm(form, options):

วิธีการคำอธิบาย
passIdCheckify Pass public ID (required unless set on the form via data-checkify-pass)
requestTypeRequest type (human, age_over_18, etc.)
buttonTargetContainer element where the verify button is rendered
submitButtonSubmit control to enable after verification
hiddenInputHidden field selector for request_id
disableSubmitUntilVerifiedWhen true, keeps submit disabled until verification succeeds

Checkify.createHumanGate(options)

ประตูเต็มหน้าหรือใน container ที่บล็อกเนื้อหาจนกว่าการยืนยันจะเสร็จ

Checkify.createHumanGate({
  passId: 'YOUR_PASS_ID',
  requestType: 'human',
  container: '#gate-root',
  title: 'Verify to continue'
});

ขั้นตอน Return URL

เมื่อผู้ใช้ทำการยืนยันในแอป Checkify เสร็จ อาจกลับมายังไซต์ของคุณพร้อม checkify_request_id ใน query string SDK จะเรียก Checkify.checkReturnedVerification() โดยอัตโนมัติเมื่อโหลด

Checkify.verify(options)

Start verification programmatically without auto-mounting HTML. Returns a promise that resolves when the user completes or cancels.

const result = await Checkify.verify({
  passId: 'YOUR_PASS_ID',
  requestType: 'human',
  container: document.getElementById('checkify-root')
});
console.log(result.requestId); // send to your server as request_id

เหตุการณ์

window.addEventListener('checkify:verified', (e) => {
  console.log('Verified', e.detail);
});

window.addEventListener('checkify:error', (e) => {
  console.error('Checkify error', e.detail);
});

Status polling (optional)

Most integrations should verify on form submit with POST /v1/qr/results/verify. For custom frontends without the embed, you may poll status while the user completes verification in the app.

ยืนยันฝั่งเซิร์ฟเวอร์

วิธีการ

วิธีการคำอธิบาย
Checkify.mount(root?)Mount widget Pass ภายใต้ root element ที่ระบุ (ถ้ามี)
Checkify.bindForm(...)ตัวช่วยเชื่อมต่อแบบฟอร์ม
Checkify.createHumanGate(...)UI ประตูยืนยันมนุษย์
Checkify.verify(options)ขั้นตอนยืนยันแบบ programmatic
Checkify.checkReturnedVerification()จัดการ return URL หลังส่งต่อจากแอป