@worldcoin/idkit-core 4.0.3 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -56,7 +56,20 @@ const request = await IDKit.request({
56
56
  const qrUrl = request.connectorURI;
57
57
  ```
58
58
 
59
- **Available presets:** `orbLegacy`, `documentLegacy`, `secureDocumentLegacy`
59
+ **Available presets:** `orbLegacy`, `documentLegacy`, `secureDocumentLegacy`, `selfieCheck`
60
+
61
+ Selfie check preset example:
62
+
63
+ ```typescript
64
+ import { IDKit, selfieCheck } from "@worldcoin/idkit-core";
65
+
66
+ const request = await IDKit.request({
67
+ app_id: "app_xxxxx",
68
+ action: "my-action",
69
+ rp_context: rpContext,
70
+ allow_legacy_proofs: false,
71
+ }).preset(selfieCheck({ signal: "user-123" }));
72
+ ```
60
73
 
61
74
  ## Handling the Result
62
75
 
Binary file
package/dist/index.cjs CHANGED
@@ -392,14 +392,14 @@ function hashSignal(signal) {
392
392
  wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
393
393
  }
394
394
  }
395
- function __wasm_bindgen_func_elem_599(arg0, arg1) {
396
- wasm.__wasm_bindgen_func_elem_599(arg0, arg1);
395
+ function __wasm_bindgen_func_elem_968(arg0, arg1, arg2) {
396
+ wasm.__wasm_bindgen_func_elem_968(arg0, arg1, addHeapObject(arg2));
397
397
  }
398
- function __wasm_bindgen_func_elem_962(arg0, arg1, arg2) {
399
- wasm.__wasm_bindgen_func_elem_962(arg0, arg1, addHeapObject(arg2));
398
+ function __wasm_bindgen_func_elem_605(arg0, arg1) {
399
+ wasm.__wasm_bindgen_func_elem_605(arg0, arg1);
400
400
  }
401
- function __wasm_bindgen_func_elem_1347(arg0, arg1, arg2, arg3) {
402
- wasm.__wasm_bindgen_func_elem_1347(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
401
+ function __wasm_bindgen_func_elem_1353(arg0, arg1, arg2, arg3) {
402
+ wasm.__wasm_bindgen_func_elem_1353(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
403
403
  }
404
404
  var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
405
405
  var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -1562,7 +1562,7 @@ function __wbg_get_imports() {
1562
1562
  const a = state0.a;
1563
1563
  state0.a = 0;
1564
1564
  try {
1565
- return __wasm_bindgen_func_elem_1347(a, state0.b, arg02, arg12);
1565
+ return __wasm_bindgen_func_elem_1353(a, state0.b, arg02, arg12);
1566
1566
  } finally {
1567
1567
  state0.a = a;
1568
1568
  }
@@ -1771,12 +1771,12 @@ function __wbg_get_imports() {
1771
1771
  const ret = getObject(arg0).versions;
1772
1772
  return addHeapObject(ret);
1773
1773
  };
1774
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1775
- const ret = getStringFromWasm0(arg0, arg1);
1774
+ imports.wbg.__wbindgen_cast_02740531cfdb05fe = function(arg0, arg1) {
1775
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_604, __wasm_bindgen_func_elem_605);
1776
1776
  return addHeapObject(ret);
1777
1777
  };
1778
- imports.wbg.__wbindgen_cast_2d12912bac8cf5ca = function(arg0, arg1) {
1779
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_961, __wasm_bindgen_func_elem_962);
1778
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1779
+ const ret = getStringFromWasm0(arg0, arg1);
1780
1780
  return addHeapObject(ret);
1781
1781
  };
1782
1782
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
@@ -1787,10 +1787,6 @@ function __wbg_get_imports() {
1787
1787
  const ret = arg0;
1788
1788
  return addHeapObject(ret);
1789
1789
  };
1790
- imports.wbg.__wbindgen_cast_b8b1061c2d0ea705 = function(arg0, arg1) {
1791
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_598, __wasm_bindgen_func_elem_599);
1792
- return addHeapObject(ret);
1793
- };
1794
1790
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
1795
1791
  const ret = getArrayU8FromWasm0(arg0, arg1);
1796
1792
  return addHeapObject(ret);
@@ -1799,6 +1795,10 @@ function __wbg_get_imports() {
1799
1795
  const ret = arg0;
1800
1796
  return addHeapObject(ret);
1801
1797
  };
1798
+ imports.wbg.__wbindgen_cast_f23235b6472d5cf3 = function(arg0, arg1) {
1799
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_967, __wasm_bindgen_func_elem_968);
1800
+ return addHeapObject(ret);
1801
+ };
1802
1802
  imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
1803
1803
  const ret = getObject(arg0);
1804
1804
  return addHeapObject(ret);
@@ -2162,6 +2162,9 @@ function secureDocumentLegacy(opts = {}) {
2162
2162
  function documentLegacy(opts = {}) {
2163
2163
  return { type: "DocumentLegacy", signal: opts.signal };
2164
2164
  }
2165
+ function selfieCheck(opts = {}) {
2166
+ return { type: "SelfieCheck", signal: opts.signal };
2167
+ }
2165
2168
  function createWasmBuilderFromConfig(config) {
2166
2169
  if (!config.rp_context) {
2167
2170
  throw new Error("rp_context is required for WASM bridge transport");
@@ -2243,7 +2246,7 @@ var IDKitBuilder2 = class {
2243
2246
  * Presets provide a simplified way to create requests with predefined
2244
2247
  * credential configurations.
2245
2248
  *
2246
- * @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), or documentLegacy()
2249
+ * @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), documentLegacy(), or selfieCheck()
2247
2250
  * @returns A new IDKitRequest instance
2248
2251
  *
2249
2252
  * @example
@@ -2319,7 +2322,9 @@ var IDKit = {
2319
2322
  /** Create a SecureDocumentLegacy preset for World ID 3.0 legacy support */
2320
2323
  secureDocumentLegacy,
2321
2324
  /** Create a DocumentLegacy preset for World ID 3.0 legacy support */
2322
- documentLegacy
2325
+ documentLegacy,
2326
+ /** Create a SelfieCheck preset for face verification */
2327
+ selfieCheck
2323
2328
  };
2324
2329
 
2325
2330
  // src/lib/platform.ts
@@ -2366,3 +2371,4 @@ exports.isReactNative = isReactNative;
2366
2371
  exports.isWeb = isWeb;
2367
2372
  exports.orbLegacy = orbLegacy;
2368
2373
  exports.secureDocumentLegacy = secureDocumentLegacy;
2374
+ exports.selfieCheck = selfieCheck;
package/dist/index.d.cts CHANGED
@@ -98,7 +98,13 @@ interface DocumentLegacyPreset {
98
98
  signal?: string;
99
99
  }
100
100
 
101
- type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset;
101
+ interface SelfieCheckPreset {
102
+ /** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
103
+ type: "SelfieCheck";
104
+ signal?: string;
105
+ }
106
+
107
+ type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckPreset;
102
108
 
103
109
 
104
110
 
@@ -384,6 +390,27 @@ declare function secureDocumentLegacy(opts?: {
384
390
  declare function documentLegacy(opts?: {
385
391
  signal?: string;
386
392
  }): DocumentLegacyPreset;
393
+ /**
394
+ * Creates a SelfieCheck preset for face verification
395
+ *
396
+ * Preview: Selfie Check is currently in preview.
397
+ * Contact us if you need it enabled.
398
+ *
399
+ * This preset requests face credentials in v4 constraints.
400
+ * In legacy compatibility fields, it maps to verification level "face".
401
+ *
402
+ * @param opts - Optional configuration with signal
403
+ * @returns A SelfieCheck preset
404
+ *
405
+ * @example
406
+ * ```typescript
407
+ * const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
408
+ * .preset(selfieCheck({ signal: 'user-123' }))
409
+ * ```
410
+ */
411
+ declare function selfieCheck(opts?: {
412
+ signal?: string;
413
+ }): SelfieCheckPreset;
387
414
  /**
388
415
  * Builder for IDKit requests
389
416
  *
@@ -413,7 +440,7 @@ declare class IDKitBuilder {
413
440
  * Presets provide a simplified way to create requests with predefined
414
441
  * credential configurations.
415
442
  *
416
- * @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), or documentLegacy()
443
+ * @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), documentLegacy(), or selfieCheck()
417
444
  * @returns A new IDKitRequest instance
418
445
  *
419
446
  * @example
@@ -493,6 +520,8 @@ declare const IDKit: {
493
520
  secureDocumentLegacy: typeof secureDocumentLegacy;
494
521
  /** Create a DocumentLegacy preset for World ID 3.0 legacy support */
495
522
  documentLegacy: typeof documentLegacy;
523
+ /** Create a SelfieCheck preset for face verification */
524
+ selfieCheck: typeof selfieCheck;
496
525
  };
497
526
 
498
527
  /**
@@ -517,4 +546,4 @@ declare const isWeb: () => boolean;
517
546
  */
518
547
  declare const isNode: () => boolean;
519
548
 
520
- export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DocumentLegacyPreset, IDKit, type IDKitCompletionResult, type IDKitErrorCode, IDKitErrorCodes, type IDKitRequest, type IDKitRequestConfig, type IDKitResult, type IDKitResultSession, type IDKitSessionConfig, type OrbLegacyPreset, type Preset, type ResponseItemSession, type ResponseItemV3, type ResponseItemV4, type RpContext, type SecureDocumentLegacyPreset, type Status$1 as Status, type WaitOptions, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy };
549
+ export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DocumentLegacyPreset, IDKit, type IDKitCompletionResult, type IDKitErrorCode, IDKitErrorCodes, type IDKitRequest, type IDKitRequestConfig, type IDKitResult, type IDKitResultSession, type IDKitSessionConfig, type OrbLegacyPreset, type Preset, type ResponseItemSession, type ResponseItemV3, type ResponseItemV4, type RpContext, type SecureDocumentLegacyPreset, type SelfieCheckPreset, type Status$1 as Status, type WaitOptions, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheck };
package/dist/index.d.ts CHANGED
@@ -98,7 +98,13 @@ interface DocumentLegacyPreset {
98
98
  signal?: string;
99
99
  }
100
100
 
101
- type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset;
101
+ interface SelfieCheckPreset {
102
+ /** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
103
+ type: "SelfieCheck";
104
+ signal?: string;
105
+ }
106
+
107
+ type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckPreset;
102
108
 
103
109
 
104
110
 
@@ -384,6 +390,27 @@ declare function secureDocumentLegacy(opts?: {
384
390
  declare function documentLegacy(opts?: {
385
391
  signal?: string;
386
392
  }): DocumentLegacyPreset;
393
+ /**
394
+ * Creates a SelfieCheck preset for face verification
395
+ *
396
+ * Preview: Selfie Check is currently in preview.
397
+ * Contact us if you need it enabled.
398
+ *
399
+ * This preset requests face credentials in v4 constraints.
400
+ * In legacy compatibility fields, it maps to verification level "face".
401
+ *
402
+ * @param opts - Optional configuration with signal
403
+ * @returns A SelfieCheck preset
404
+ *
405
+ * @example
406
+ * ```typescript
407
+ * const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
408
+ * .preset(selfieCheck({ signal: 'user-123' }))
409
+ * ```
410
+ */
411
+ declare function selfieCheck(opts?: {
412
+ signal?: string;
413
+ }): SelfieCheckPreset;
387
414
  /**
388
415
  * Builder for IDKit requests
389
416
  *
@@ -413,7 +440,7 @@ declare class IDKitBuilder {
413
440
  * Presets provide a simplified way to create requests with predefined
414
441
  * credential configurations.
415
442
  *
416
- * @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), or documentLegacy()
443
+ * @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), documentLegacy(), or selfieCheck()
417
444
  * @returns A new IDKitRequest instance
418
445
  *
419
446
  * @example
@@ -493,6 +520,8 @@ declare const IDKit: {
493
520
  secureDocumentLegacy: typeof secureDocumentLegacy;
494
521
  /** Create a DocumentLegacy preset for World ID 3.0 legacy support */
495
522
  documentLegacy: typeof documentLegacy;
523
+ /** Create a SelfieCheck preset for face verification */
524
+ selfieCheck: typeof selfieCheck;
496
525
  };
497
526
 
498
527
  /**
@@ -517,4 +546,4 @@ declare const isWeb: () => boolean;
517
546
  */
518
547
  declare const isNode: () => boolean;
519
548
 
520
- export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DocumentLegacyPreset, IDKit, type IDKitCompletionResult, type IDKitErrorCode, IDKitErrorCodes, type IDKitRequest, type IDKitRequestConfig, type IDKitResult, type IDKitResultSession, type IDKitSessionConfig, type OrbLegacyPreset, type Preset, type ResponseItemSession, type ResponseItemV3, type ResponseItemV4, type RpContext, type SecureDocumentLegacyPreset, type Status$1 as Status, type WaitOptions, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy };
549
+ export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DocumentLegacyPreset, IDKit, type IDKitCompletionResult, type IDKitErrorCode, IDKitErrorCodes, type IDKitRequest, type IDKitRequestConfig, type IDKitResult, type IDKitResultSession, type IDKitSessionConfig, type OrbLegacyPreset, type Preset, type ResponseItemSession, type ResponseItemV3, type ResponseItemV4, type RpContext, type SecureDocumentLegacyPreset, type SelfieCheckPreset, type Status$1 as Status, type WaitOptions, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheck };
package/dist/index.js CHANGED
@@ -389,14 +389,14 @@ function hashSignal(signal) {
389
389
  wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
390
390
  }
391
391
  }
392
- function __wasm_bindgen_func_elem_599(arg0, arg1) {
393
- wasm.__wasm_bindgen_func_elem_599(arg0, arg1);
392
+ function __wasm_bindgen_func_elem_968(arg0, arg1, arg2) {
393
+ wasm.__wasm_bindgen_func_elem_968(arg0, arg1, addHeapObject(arg2));
394
394
  }
395
- function __wasm_bindgen_func_elem_962(arg0, arg1, arg2) {
396
- wasm.__wasm_bindgen_func_elem_962(arg0, arg1, addHeapObject(arg2));
395
+ function __wasm_bindgen_func_elem_605(arg0, arg1) {
396
+ wasm.__wasm_bindgen_func_elem_605(arg0, arg1);
397
397
  }
398
- function __wasm_bindgen_func_elem_1347(arg0, arg1, arg2, arg3) {
399
- wasm.__wasm_bindgen_func_elem_1347(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
398
+ function __wasm_bindgen_func_elem_1353(arg0, arg1, arg2, arg3) {
399
+ wasm.__wasm_bindgen_func_elem_1353(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
400
400
  }
401
401
  var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
402
402
  var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -1559,7 +1559,7 @@ function __wbg_get_imports() {
1559
1559
  const a = state0.a;
1560
1560
  state0.a = 0;
1561
1561
  try {
1562
- return __wasm_bindgen_func_elem_1347(a, state0.b, arg02, arg12);
1562
+ return __wasm_bindgen_func_elem_1353(a, state0.b, arg02, arg12);
1563
1563
  } finally {
1564
1564
  state0.a = a;
1565
1565
  }
@@ -1768,12 +1768,12 @@ function __wbg_get_imports() {
1768
1768
  const ret = getObject(arg0).versions;
1769
1769
  return addHeapObject(ret);
1770
1770
  };
1771
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1772
- const ret = getStringFromWasm0(arg0, arg1);
1771
+ imports.wbg.__wbindgen_cast_02740531cfdb05fe = function(arg0, arg1) {
1772
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_604, __wasm_bindgen_func_elem_605);
1773
1773
  return addHeapObject(ret);
1774
1774
  };
1775
- imports.wbg.__wbindgen_cast_2d12912bac8cf5ca = function(arg0, arg1) {
1776
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_961, __wasm_bindgen_func_elem_962);
1775
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1776
+ const ret = getStringFromWasm0(arg0, arg1);
1777
1777
  return addHeapObject(ret);
1778
1778
  };
1779
1779
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
@@ -1784,10 +1784,6 @@ function __wbg_get_imports() {
1784
1784
  const ret = arg0;
1785
1785
  return addHeapObject(ret);
1786
1786
  };
1787
- imports.wbg.__wbindgen_cast_b8b1061c2d0ea705 = function(arg0, arg1) {
1788
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_598, __wasm_bindgen_func_elem_599);
1789
- return addHeapObject(ret);
1790
- };
1791
1787
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
1792
1788
  const ret = getArrayU8FromWasm0(arg0, arg1);
1793
1789
  return addHeapObject(ret);
@@ -1796,6 +1792,10 @@ function __wbg_get_imports() {
1796
1792
  const ret = arg0;
1797
1793
  return addHeapObject(ret);
1798
1794
  };
1795
+ imports.wbg.__wbindgen_cast_f23235b6472d5cf3 = function(arg0, arg1) {
1796
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_967, __wasm_bindgen_func_elem_968);
1797
+ return addHeapObject(ret);
1798
+ };
1799
1799
  imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
1800
1800
  const ret = getObject(arg0);
1801
1801
  return addHeapObject(ret);
@@ -2159,6 +2159,9 @@ function secureDocumentLegacy(opts = {}) {
2159
2159
  function documentLegacy(opts = {}) {
2160
2160
  return { type: "DocumentLegacy", signal: opts.signal };
2161
2161
  }
2162
+ function selfieCheck(opts = {}) {
2163
+ return { type: "SelfieCheck", signal: opts.signal };
2164
+ }
2162
2165
  function createWasmBuilderFromConfig(config) {
2163
2166
  if (!config.rp_context) {
2164
2167
  throw new Error("rp_context is required for WASM bridge transport");
@@ -2240,7 +2243,7 @@ var IDKitBuilder2 = class {
2240
2243
  * Presets provide a simplified way to create requests with predefined
2241
2244
  * credential configurations.
2242
2245
  *
2243
- * @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), or documentLegacy()
2246
+ * @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), documentLegacy(), or selfieCheck()
2244
2247
  * @returns A new IDKitRequest instance
2245
2248
  *
2246
2249
  * @example
@@ -2316,7 +2319,9 @@ var IDKit = {
2316
2319
  /** Create a SecureDocumentLegacy preset for World ID 3.0 legacy support */
2317
2320
  secureDocumentLegacy,
2318
2321
  /** Create a DocumentLegacy preset for World ID 3.0 legacy support */
2319
- documentLegacy
2322
+ documentLegacy,
2323
+ /** Create a SelfieCheck preset for face verification */
2324
+ selfieCheck
2320
2325
  };
2321
2326
 
2322
2327
  // src/lib/platform.ts
@@ -2350,4 +2355,4 @@ function isValidHex(s) {
2350
2355
  return /^[0-9a-fA-F]+$/.test(s);
2351
2356
  }
2352
2357
 
2353
- export { IDKit, IDKitErrorCodes, documentLegacy, hashSignal2 as hashSignal, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy };
2358
+ export { IDKit, IDKitErrorCodes, documentLegacy, hashSignal2 as hashSignal, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheck };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldcoin/idkit-core",
3
- "version": "4.0.3",
3
+ "version": "4.0.6",
4
4
  "description": "Core IDKit SDK for World ID - Pure TypeScript, no dependencies",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@noble/hashes": "^1.7.2",
55
- "@worldcoin/idkit-server": "workspace:*"
55
+ "@worldcoin/idkit-server": "1.0.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/node": "^20.19.30",