@worldcoin/idkit-core 4.0.11 → 4.0.13-dev.cd5a8f0

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/dist/index.d.cts CHANGED
@@ -85,7 +85,7 @@ type IDKitSessionConfig = {
85
85
 
86
86
  /** V4 response item for World ID v4 uniqueness proofs */
87
87
  interface ResponseItemV4 {
88
- /** Credential identifier (e.g., "orb", "face", "document") */
88
+ /** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
89
89
  identifier: string;
90
90
  /** Signal hash (optional, included if signal was provided in request) */
91
91
  signal_hash?: string;
@@ -93,7 +93,7 @@ interface ResponseItemV4 {
93
93
  proof: string[];
94
94
  /** RP-scoped nullifier (hex) */
95
95
  nullifier: string;
96
- /** Credential issuer schema ID (1=orb, 2=face, 3=secure_document, 4=document, 5=device) */
96
+ /** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
97
97
  issuer_schema_id: number;
98
98
  /** Minimum expiration timestamp (unix seconds) */
99
99
  expires_at_min: number;
@@ -101,7 +101,7 @@ interface ResponseItemV4 {
101
101
 
102
102
  /** V3 response item for World ID v3 (legacy format) */
103
103
  interface ResponseItemV3 {
104
- /** Credential identifier (e.g., "orb", "face") */
104
+ /** Credential identifier (e.g., "proof_of_human", "face") */
105
105
  identifier: string;
106
106
  /** Signal hash (optional, included if signal was provided in request) */
107
107
  signal_hash?: string;
@@ -115,7 +115,7 @@ interface ResponseItemV3 {
115
115
 
116
116
  /** Session response item for World ID v4 session proofs */
117
117
  interface ResponseItemSession {
118
- /** Credential identifier (e.g., "orb", "face", "document") */
118
+ /** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
119
119
  identifier: string;
120
120
  /** Signal hash (optional, included if signal was provided in request) */
121
121
  signal_hash?: string;
@@ -123,7 +123,7 @@ interface ResponseItemSession {
123
123
  proof: string[];
124
124
  /** Session nullifier: 1st element is the session nullifier, 2nd is the generated action (hex strings) */
125
125
  session_nullifier: string[];
126
- /** Credential issuer schema ID (1=orb, 2=face, 3=secure_document, 4=document, 5=device) */
126
+ /** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
127
127
  issuer_schema_id: number;
128
128
  /** Minimum expiration timestamp (unix seconds) */
129
129
  expires_at_min: number;
@@ -187,43 +187,25 @@ type IDKitResult = IDKitResultV3 | IDKitResultV4 | IDKitResultSession;
187
187
 
188
188
  /** Error codes from World App (mirrors Rust AppError) */
189
189
  type IDKitErrorCode =
190
- | "user_rejected"
191
- | "verification_rejected"
192
- | "credential_unavailable"
193
- | "malformed_request"
194
- | "invalid_network"
195
- | "inclusion_proof_pending"
196
- | "inclusion_proof_failed"
197
- | "unexpected_response"
198
- | "connection_failed"
199
- | "max_verifications_reached"
200
- | "failed_by_host_app"
201
- | "generic_error";
190
+ | "user_rejected"
191
+ | "verification_rejected"
192
+ | "credential_unavailable"
193
+ | "malformed_request"
194
+ | "invalid_network"
195
+ | "inclusion_proof_pending"
196
+ | "inclusion_proof_failed"
197
+ | "unexpected_response"
198
+ | "connection_failed"
199
+ | "max_verifications_reached"
200
+ | "failed_by_host_app"
201
+ | "generic_error";
202
202
 
203
203
  /** Status returned from pollForStatus() */
204
204
  type Status$1 =
205
- | { type: "waiting_for_connection" }
206
- | { type: "awaiting_confirmation" }
207
- | { type: "confirmed"; result: IDKitResult }
208
- | { type: "failed"; error: IDKitErrorCode };
209
-
210
-
211
-
212
- type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
213
-
214
- interface CredentialRequestType {
215
- type: CredentialType;
216
- /** Signal can be a string or raw bytes (Uint8Array) */
217
- signal?: string | Uint8Array;
218
- genesis_issued_at_min?: number;
219
- expires_at_min?: number;
220
- }
221
-
222
- type ConstraintNode =
223
- | CredentialRequestType
224
- | { any: ConstraintNode[] }
225
- | { all: ConstraintNode[] }
226
- | { enumerate: ConstraintNode[] };
205
+ | { type: "waiting_for_connection" }
206
+ | { type: "awaiting_confirmation" }
207
+ | { type: "confirmed"; result: IDKitResult }
208
+ | { type: "failed"; error: IDKitErrorCode };
227
209
 
228
210
 
229
211
 
@@ -260,6 +242,24 @@ interface DeviceLegacyPreset {
260
242
 
261
243
  type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
262
244
 
245
+
246
+
247
+ type CredentialType = "proof_of_human" | "face" | "passport" | "mnc";
248
+
249
+ interface CredentialRequestType {
250
+ type: CredentialType;
251
+ /** Signal can be a string or raw bytes (Uint8Array) */
252
+ signal?: string | Uint8Array;
253
+ genesis_issued_at_min?: number;
254
+ expires_at_min?: number;
255
+ }
256
+
257
+ type ConstraintNode =
258
+ | CredentialRequestType
259
+ | { any: ConstraintNode[] }
260
+ | { all: ConstraintNode[] }
261
+ | { enumerate: ConstraintNode[] };
262
+
263
263
  /**
264
264
  * Result types - re-exported from WASM bindings
265
265
  *
@@ -288,6 +288,10 @@ declare enum IDKitErrorCodes {
288
288
  Cancelled = "cancelled"
289
289
  }
290
290
 
291
+ /**
292
+ * Check if running inside World App
293
+ */
294
+ declare function isInWorldApp(): boolean;
291
295
  interface BuilderConfig {
292
296
  type: "request" | "session" | "proveSession";
293
297
  app_id: string;
@@ -453,7 +457,7 @@ declare class IDKitBuilder {
453
457
  * @example
454
458
  * ```typescript
455
459
  * const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
456
- * .constraints(any(CredentialRequest('orb'), CredentialRequest('face')));
460
+ * .constraints(any(CredentialRequest('proof_of_human'), CredentialRequest('face')));
457
461
  * ```
458
462
  */
459
463
  constraints(constraints: ConstraintNode): Promise<IDKitRequest>;
@@ -502,7 +506,7 @@ declare class IDKitBuilder {
502
506
  * action: 'my-action',
503
507
  * rp_context: { ... },
504
508
  * allow_legacy_proofs: false,
505
- * }).constraints(enumerate(CredentialRequest('orb'), CredentialRequest('face')));
509
+ * }).constraints(enumerate(CredentialRequest('proof_of_human'), CredentialRequest('face')));
506
510
  *
507
511
  * // In World App: connectorURI is empty, result comes via postMessage
508
512
  * // On web: connectorURI is the QR URL to display
@@ -571,4 +575,4 @@ declare const isWeb: () => boolean;
571
575
  */
572
576
  declare const isNode: () => boolean;
573
577
 
574
- export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DeviceLegacyPreset, 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 SelfieCheckLegacyPreset, type Status$1 as Status, type WaitOptions, deviceLegacy, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheckLegacy };
578
+ export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DeviceLegacyPreset, 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 SelfieCheckLegacyPreset, type Status$1 as Status, type WaitOptions, deviceLegacy, documentLegacy, isInWorldApp, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheckLegacy };
package/dist/index.d.ts CHANGED
@@ -85,7 +85,7 @@ type IDKitSessionConfig = {
85
85
 
86
86
  /** V4 response item for World ID v4 uniqueness proofs */
87
87
  interface ResponseItemV4 {
88
- /** Credential identifier (e.g., "orb", "face", "document") */
88
+ /** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
89
89
  identifier: string;
90
90
  /** Signal hash (optional, included if signal was provided in request) */
91
91
  signal_hash?: string;
@@ -93,7 +93,7 @@ interface ResponseItemV4 {
93
93
  proof: string[];
94
94
  /** RP-scoped nullifier (hex) */
95
95
  nullifier: string;
96
- /** Credential issuer schema ID (1=orb, 2=face, 3=secure_document, 4=document, 5=device) */
96
+ /** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
97
97
  issuer_schema_id: number;
98
98
  /** Minimum expiration timestamp (unix seconds) */
99
99
  expires_at_min: number;
@@ -101,7 +101,7 @@ interface ResponseItemV4 {
101
101
 
102
102
  /** V3 response item for World ID v3 (legacy format) */
103
103
  interface ResponseItemV3 {
104
- /** Credential identifier (e.g., "orb", "face") */
104
+ /** Credential identifier (e.g., "proof_of_human", "face") */
105
105
  identifier: string;
106
106
  /** Signal hash (optional, included if signal was provided in request) */
107
107
  signal_hash?: string;
@@ -115,7 +115,7 @@ interface ResponseItemV3 {
115
115
 
116
116
  /** Session response item for World ID v4 session proofs */
117
117
  interface ResponseItemSession {
118
- /** Credential identifier (e.g., "orb", "face", "document") */
118
+ /** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
119
119
  identifier: string;
120
120
  /** Signal hash (optional, included if signal was provided in request) */
121
121
  signal_hash?: string;
@@ -123,7 +123,7 @@ interface ResponseItemSession {
123
123
  proof: string[];
124
124
  /** Session nullifier: 1st element is the session nullifier, 2nd is the generated action (hex strings) */
125
125
  session_nullifier: string[];
126
- /** Credential issuer schema ID (1=orb, 2=face, 3=secure_document, 4=document, 5=device) */
126
+ /** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
127
127
  issuer_schema_id: number;
128
128
  /** Minimum expiration timestamp (unix seconds) */
129
129
  expires_at_min: number;
@@ -187,43 +187,25 @@ type IDKitResult = IDKitResultV3 | IDKitResultV4 | IDKitResultSession;
187
187
 
188
188
  /** Error codes from World App (mirrors Rust AppError) */
189
189
  type IDKitErrorCode =
190
- | "user_rejected"
191
- | "verification_rejected"
192
- | "credential_unavailable"
193
- | "malformed_request"
194
- | "invalid_network"
195
- | "inclusion_proof_pending"
196
- | "inclusion_proof_failed"
197
- | "unexpected_response"
198
- | "connection_failed"
199
- | "max_verifications_reached"
200
- | "failed_by_host_app"
201
- | "generic_error";
190
+ | "user_rejected"
191
+ | "verification_rejected"
192
+ | "credential_unavailable"
193
+ | "malformed_request"
194
+ | "invalid_network"
195
+ | "inclusion_proof_pending"
196
+ | "inclusion_proof_failed"
197
+ | "unexpected_response"
198
+ | "connection_failed"
199
+ | "max_verifications_reached"
200
+ | "failed_by_host_app"
201
+ | "generic_error";
202
202
 
203
203
  /** Status returned from pollForStatus() */
204
204
  type Status$1 =
205
- | { type: "waiting_for_connection" }
206
- | { type: "awaiting_confirmation" }
207
- | { type: "confirmed"; result: IDKitResult }
208
- | { type: "failed"; error: IDKitErrorCode };
209
-
210
-
211
-
212
- type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
213
-
214
- interface CredentialRequestType {
215
- type: CredentialType;
216
- /** Signal can be a string or raw bytes (Uint8Array) */
217
- signal?: string | Uint8Array;
218
- genesis_issued_at_min?: number;
219
- expires_at_min?: number;
220
- }
221
-
222
- type ConstraintNode =
223
- | CredentialRequestType
224
- | { any: ConstraintNode[] }
225
- | { all: ConstraintNode[] }
226
- | { enumerate: ConstraintNode[] };
205
+ | { type: "waiting_for_connection" }
206
+ | { type: "awaiting_confirmation" }
207
+ | { type: "confirmed"; result: IDKitResult }
208
+ | { type: "failed"; error: IDKitErrorCode };
227
209
 
228
210
 
229
211
 
@@ -260,6 +242,24 @@ interface DeviceLegacyPreset {
260
242
 
261
243
  type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
262
244
 
245
+
246
+
247
+ type CredentialType = "proof_of_human" | "face" | "passport" | "mnc";
248
+
249
+ interface CredentialRequestType {
250
+ type: CredentialType;
251
+ /** Signal can be a string or raw bytes (Uint8Array) */
252
+ signal?: string | Uint8Array;
253
+ genesis_issued_at_min?: number;
254
+ expires_at_min?: number;
255
+ }
256
+
257
+ type ConstraintNode =
258
+ | CredentialRequestType
259
+ | { any: ConstraintNode[] }
260
+ | { all: ConstraintNode[] }
261
+ | { enumerate: ConstraintNode[] };
262
+
263
263
  /**
264
264
  * Result types - re-exported from WASM bindings
265
265
  *
@@ -288,6 +288,10 @@ declare enum IDKitErrorCodes {
288
288
  Cancelled = "cancelled"
289
289
  }
290
290
 
291
+ /**
292
+ * Check if running inside World App
293
+ */
294
+ declare function isInWorldApp(): boolean;
291
295
  interface BuilderConfig {
292
296
  type: "request" | "session" | "proveSession";
293
297
  app_id: string;
@@ -453,7 +457,7 @@ declare class IDKitBuilder {
453
457
  * @example
454
458
  * ```typescript
455
459
  * const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
456
- * .constraints(any(CredentialRequest('orb'), CredentialRequest('face')));
460
+ * .constraints(any(CredentialRequest('proof_of_human'), CredentialRequest('face')));
457
461
  * ```
458
462
  */
459
463
  constraints(constraints: ConstraintNode): Promise<IDKitRequest>;
@@ -502,7 +506,7 @@ declare class IDKitBuilder {
502
506
  * action: 'my-action',
503
507
  * rp_context: { ... },
504
508
  * allow_legacy_proofs: false,
505
- * }).constraints(enumerate(CredentialRequest('orb'), CredentialRequest('face')));
509
+ * }).constraints(enumerate(CredentialRequest('proof_of_human'), CredentialRequest('face')));
506
510
  *
507
511
  * // In World App: connectorURI is empty, result comes via postMessage
508
512
  * // On web: connectorURI is the QR URL to display
@@ -571,4 +575,4 @@ declare const isWeb: () => boolean;
571
575
  */
572
576
  declare const isNode: () => boolean;
573
577
 
574
- export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DeviceLegacyPreset, 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 SelfieCheckLegacyPreset, type Status$1 as Status, type WaitOptions, deviceLegacy, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheckLegacy };
578
+ export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DeviceLegacyPreset, 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 SelfieCheckLegacyPreset, type Status$1 as Status, type WaitOptions, deviceLegacy, documentLegacy, isInWorldApp, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheckLegacy };