@capgo/capacitor-device-integrity 8.0.2

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/docs.json ADDED
@@ -0,0 +1,495 @@
1
+ {
2
+ "api": {
3
+ "name": "DeviceIntegrityPlugin",
4
+ "slug": "deviceintegrityplugin",
5
+ "docs": "",
6
+ "tags": [],
7
+ "methods": [
8
+ {
9
+ "name": "getCapabilities",
10
+ "signature": "() => Promise<DeviceIntegrityCapabilities>",
11
+ "parameters": [],
12
+ "returns": "Promise<DeviceIntegrityCapabilities>",
13
+ "tags": [],
14
+ "docs": "Returns the native integrity capabilities available on the current platform.",
15
+ "complexTypes": [
16
+ "DeviceIntegrityCapabilities"
17
+ ],
18
+ "slug": "getcapabilities"
19
+ },
20
+ {
21
+ "name": "getWidevineFingerprint",
22
+ "signature": "(options?: WidevineFingerprintOptions | undefined) => Promise<WidevineFingerprintResult>",
23
+ "parameters": [
24
+ {
25
+ "name": "options",
26
+ "docs": "",
27
+ "type": "WidevineFingerprintOptions | undefined"
28
+ }
29
+ ],
30
+ "returns": "Promise<WidevineFingerprintResult>",
31
+ "tags": [],
32
+ "docs": "Returns an Android Widevine-derived fingerprint.\n\nThe default `fingerprint` is SHA-256 over the Widevine device unique ID and a salt.\nIf `hashSalt` is not provided, Android uses the app package name as the salt.\n\nThe raw Widevine ID is sensitive and is only returned as base64 when `includeRawId` is true.",
33
+ "complexTypes": [
34
+ "WidevineFingerprintResult",
35
+ "WidevineFingerprintOptions"
36
+ ],
37
+ "slug": "getwidevinefingerprint"
38
+ },
39
+ {
40
+ "name": "prepareAttestation",
41
+ "signature": "(options?: PrepareAttestationOptions | undefined) => Promise<PrepareAttestationResult>",
42
+ "parameters": [
43
+ {
44
+ "name": "options",
45
+ "docs": "",
46
+ "type": "PrepareAttestationOptions | undefined"
47
+ }
48
+ ],
49
+ "returns": "Promise<PrepareAttestationResult>",
50
+ "tags": [],
51
+ "docs": "Prepares native attestation state and returns the key/provider handle.\n\niOS: creates an App Attest key.\nAndroid: prepares a Play Integrity Standard token provider.",
52
+ "complexTypes": [
53
+ "PrepareAttestationResult",
54
+ "PrepareAttestationOptions"
55
+ ],
56
+ "slug": "prepareattestation"
57
+ },
58
+ {
59
+ "name": "createAttestation",
60
+ "signature": "(options: CreateAttestationOptions) => Promise<AttestationTokenResult>",
61
+ "parameters": [
62
+ {
63
+ "name": "options",
64
+ "docs": "",
65
+ "type": "CreateAttestationOptions"
66
+ }
67
+ ],
68
+ "returns": "Promise<AttestationTokenResult>",
69
+ "tags": [],
70
+ "docs": "Creates a registration attestation token bound to a backend-issued challenge.",
71
+ "complexTypes": [
72
+ "AttestationTokenResult",
73
+ "CreateAttestationOptions"
74
+ ],
75
+ "slug": "createattestation"
76
+ },
77
+ {
78
+ "name": "createAssertion",
79
+ "signature": "(options: CreateAssertionOptions) => Promise<AttestationTokenResult>",
80
+ "parameters": [
81
+ {
82
+ "name": "options",
83
+ "docs": "",
84
+ "type": "CreateAssertionOptions"
85
+ }
86
+ ],
87
+ "returns": "Promise<AttestationTokenResult>",
88
+ "tags": [],
89
+ "docs": "Creates a request assertion token bound to a request payload.",
90
+ "complexTypes": [
91
+ "AttestationTokenResult",
92
+ "CreateAssertionOptions"
93
+ ],
94
+ "slug": "createassertion"
95
+ },
96
+ {
97
+ "name": "getDeviceCheckToken",
98
+ "signature": "() => Promise<DeviceCheckTokenResult>",
99
+ "parameters": [],
100
+ "returns": "Promise<DeviceCheckTokenResult>",
101
+ "tags": [],
102
+ "docs": "Creates an iOS DeviceCheck token for server-side fraud-state lookups.",
103
+ "complexTypes": [
104
+ "DeviceCheckTokenResult"
105
+ ],
106
+ "slug": "getdevicechecktoken"
107
+ }
108
+ ],
109
+ "properties": []
110
+ },
111
+ "interfaces": [
112
+ {
113
+ "name": "DeviceIntegrityCapabilities",
114
+ "slug": "deviceintegritycapabilities",
115
+ "docs": "",
116
+ "tags": [],
117
+ "methods": [],
118
+ "properties": [
119
+ {
120
+ "name": "platform",
121
+ "tags": [],
122
+ "docs": "Platform currently executing the plugin.",
123
+ "complexTypes": [
124
+ "DeviceIntegrityPlatform"
125
+ ],
126
+ "type": "DeviceIntegrityPlatform"
127
+ },
128
+ {
129
+ "name": "widevine",
130
+ "tags": [],
131
+ "docs": "Android Widevine DRM support.",
132
+ "complexTypes": [
133
+ "WidevineCapabilities"
134
+ ],
135
+ "type": "WidevineCapabilities"
136
+ },
137
+ {
138
+ "name": "appAttest",
139
+ "tags": [],
140
+ "docs": "iOS App Attest support.",
141
+ "complexTypes": [
142
+ "SupportStatus"
143
+ ],
144
+ "type": "SupportStatus"
145
+ },
146
+ {
147
+ "name": "deviceCheck",
148
+ "tags": [],
149
+ "docs": "iOS DeviceCheck support.",
150
+ "complexTypes": [
151
+ "SupportStatus"
152
+ ],
153
+ "type": "SupportStatus"
154
+ },
155
+ {
156
+ "name": "playIntegrity",
157
+ "tags": [],
158
+ "docs": "Android Play Integrity support.",
159
+ "complexTypes": [
160
+ "SupportStatus"
161
+ ],
162
+ "type": "SupportStatus"
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "name": "WidevineCapabilities",
168
+ "slug": "widevinecapabilities",
169
+ "docs": "",
170
+ "tags": [],
171
+ "methods": [],
172
+ "properties": [
173
+ {
174
+ "name": "supported",
175
+ "tags": [],
176
+ "docs": "Whether the Widevine DRM scheme is supported by the device.",
177
+ "complexTypes": [],
178
+ "type": "boolean"
179
+ },
180
+ {
181
+ "name": "fingerprintAvailable",
182
+ "tags": [],
183
+ "docs": "Whether the Widevine device unique ID can be read.",
184
+ "complexTypes": [],
185
+ "type": "boolean"
186
+ },
187
+ {
188
+ "name": "securityLevelScanSupported",
189
+ "tags": [],
190
+ "docs": "Whether the Widevine security level property can be read.",
191
+ "complexTypes": [],
192
+ "type": "boolean"
193
+ }
194
+ ]
195
+ },
196
+ {
197
+ "name": "SupportStatus",
198
+ "slug": "supportstatus",
199
+ "docs": "",
200
+ "tags": [],
201
+ "methods": [],
202
+ "properties": [
203
+ {
204
+ "name": "supported",
205
+ "tags": [],
206
+ "docs": "Whether the capability is available on the current device.",
207
+ "complexTypes": [],
208
+ "type": "boolean"
209
+ }
210
+ ]
211
+ },
212
+ {
213
+ "name": "WidevineFingerprintResult",
214
+ "slug": "widevinefingerprintresult",
215
+ "docs": "",
216
+ "tags": [],
217
+ "methods": [],
218
+ "properties": [
219
+ {
220
+ "name": "platform",
221
+ "tags": [],
222
+ "docs": "Always `android`.",
223
+ "complexTypes": [],
224
+ "type": "'android'"
225
+ },
226
+ {
227
+ "name": "source",
228
+ "tags": [],
229
+ "docs": "Always `widevine`.",
230
+ "complexTypes": [],
231
+ "type": "'widevine'"
232
+ },
233
+ {
234
+ "name": "fingerprint",
235
+ "tags": [],
236
+ "docs": "Salted SHA-256 fingerprint for storing alongside a user record.",
237
+ "complexTypes": [],
238
+ "type": "string"
239
+ },
240
+ {
241
+ "name": "widevineIdSha256",
242
+ "tags": [],
243
+ "docs": "Unsalted SHA-256 hash of the Widevine device unique ID.",
244
+ "complexTypes": [],
245
+ "type": "string"
246
+ },
247
+ {
248
+ "name": "widevineIdBase64",
249
+ "tags": [],
250
+ "docs": "Raw Widevine device unique ID encoded as base64.\n\nReturned only when `includeRawId` is true.",
251
+ "complexTypes": [],
252
+ "type": "string | undefined"
253
+ },
254
+ {
255
+ "name": "securityLevel",
256
+ "tags": [],
257
+ "docs": "Widevine security level when available, for example `L1` or `L3`.",
258
+ "complexTypes": [],
259
+ "type": "string | undefined"
260
+ },
261
+ {
262
+ "name": "vendor",
263
+ "tags": [],
264
+ "docs": "DRM vendor when available.",
265
+ "complexTypes": [],
266
+ "type": "string | undefined"
267
+ },
268
+ {
269
+ "name": "version",
270
+ "tags": [],
271
+ "docs": "DRM plugin version when available.",
272
+ "complexTypes": [],
273
+ "type": "string | undefined"
274
+ },
275
+ {
276
+ "name": "description",
277
+ "tags": [],
278
+ "docs": "DRM plugin description when available.",
279
+ "complexTypes": [],
280
+ "type": "string | undefined"
281
+ }
282
+ ]
283
+ },
284
+ {
285
+ "name": "WidevineFingerprintOptions",
286
+ "slug": "widevinefingerprintoptions",
287
+ "docs": "",
288
+ "tags": [],
289
+ "methods": [],
290
+ "properties": [
291
+ {
292
+ "name": "includeRawId",
293
+ "tags": [],
294
+ "docs": "Return the raw Widevine device unique ID as base64.\n\nDefaults to `false`.",
295
+ "complexTypes": [],
296
+ "type": "boolean | undefined"
297
+ },
298
+ {
299
+ "name": "hashSalt",
300
+ "tags": [],
301
+ "docs": "Optional salt used to derive `fingerprint`.\n\nAndroid uses the app package name when omitted.",
302
+ "complexTypes": [],
303
+ "type": "string | undefined"
304
+ }
305
+ ]
306
+ },
307
+ {
308
+ "name": "PrepareAttestationResult",
309
+ "slug": "prepareattestationresult",
310
+ "docs": "",
311
+ "tags": [],
312
+ "methods": [],
313
+ "properties": [
314
+ {
315
+ "name": "keyId",
316
+ "tags": [],
317
+ "docs": "iOS App Attest key ID or Android Play Integrity provider handle ID.",
318
+ "complexTypes": [],
319
+ "type": "string"
320
+ },
321
+ {
322
+ "name": "format",
323
+ "tags": [],
324
+ "docs": "Native attestation format used by the current platform.",
325
+ "complexTypes": [
326
+ "AttestationFormat"
327
+ ],
328
+ "type": "AttestationFormat"
329
+ }
330
+ ]
331
+ },
332
+ {
333
+ "name": "PrepareAttestationOptions",
334
+ "slug": "prepareattestationoptions",
335
+ "docs": "",
336
+ "tags": [],
337
+ "methods": [],
338
+ "properties": [
339
+ {
340
+ "name": "cloudProjectNumber",
341
+ "tags": [],
342
+ "docs": "Android only. Google Cloud project number for Play Integrity.\n\nCan be configured globally via `plugins.DeviceIntegrity.cloudProjectNumber`.",
343
+ "complexTypes": [],
344
+ "type": "string | undefined"
345
+ }
346
+ ]
347
+ },
348
+ {
349
+ "name": "AttestationTokenResult",
350
+ "slug": "attestationtokenresult",
351
+ "docs": "",
352
+ "tags": [],
353
+ "methods": [],
354
+ "properties": [
355
+ {
356
+ "name": "token",
357
+ "tags": [],
358
+ "docs": "Token/assertion that must be verified server-side.",
359
+ "complexTypes": [],
360
+ "type": "string"
361
+ },
362
+ {
363
+ "name": "keyId",
364
+ "tags": [],
365
+ "docs": "Key/provider handle used to create the token.",
366
+ "complexTypes": [],
367
+ "type": "string"
368
+ },
369
+ {
370
+ "name": "format",
371
+ "tags": [],
372
+ "docs": "Native attestation format used by the current platform.",
373
+ "complexTypes": [
374
+ "AttestationFormat"
375
+ ],
376
+ "type": "AttestationFormat"
377
+ }
378
+ ]
379
+ },
380
+ {
381
+ "name": "CreateAttestationOptions",
382
+ "slug": "createattestationoptions",
383
+ "docs": "",
384
+ "tags": [],
385
+ "methods": [],
386
+ "properties": [
387
+ {
388
+ "name": "keyId",
389
+ "tags": [],
390
+ "docs": "Key/provider handle returned from `prepareAttestation()`.",
391
+ "complexTypes": [],
392
+ "type": "string"
393
+ },
394
+ {
395
+ "name": "challenge",
396
+ "tags": [],
397
+ "docs": "Backend-issued one-time challenge.",
398
+ "complexTypes": [],
399
+ "type": "string"
400
+ },
401
+ {
402
+ "name": "cloudProjectNumber",
403
+ "tags": [],
404
+ "docs": "Android only. Google Cloud project number for Play Integrity.",
405
+ "complexTypes": [],
406
+ "type": "string | undefined"
407
+ }
408
+ ]
409
+ },
410
+ {
411
+ "name": "CreateAssertionOptions",
412
+ "slug": "createassertionoptions",
413
+ "docs": "",
414
+ "tags": [],
415
+ "methods": [],
416
+ "properties": [
417
+ {
418
+ "name": "keyId",
419
+ "tags": [],
420
+ "docs": "Key/provider handle returned from `prepareAttestation()`.",
421
+ "complexTypes": [],
422
+ "type": "string"
423
+ },
424
+ {
425
+ "name": "payload",
426
+ "tags": [],
427
+ "docs": "Backend-issued one-time request payload or nonce.",
428
+ "complexTypes": [],
429
+ "type": "string"
430
+ },
431
+ {
432
+ "name": "cloudProjectNumber",
433
+ "tags": [],
434
+ "docs": "Android only. Google Cloud project number for Play Integrity.",
435
+ "complexTypes": [],
436
+ "type": "string | undefined"
437
+ }
438
+ ]
439
+ },
440
+ {
441
+ "name": "DeviceCheckTokenResult",
442
+ "slug": "devicechecktokenresult",
443
+ "docs": "",
444
+ "tags": [],
445
+ "methods": [],
446
+ "properties": [
447
+ {
448
+ "name": "token",
449
+ "tags": [],
450
+ "docs": "iOS DeviceCheck token encoded as base64.",
451
+ "complexTypes": [],
452
+ "type": "string"
453
+ }
454
+ ]
455
+ }
456
+ ],
457
+ "enums": [],
458
+ "typeAliases": [
459
+ {
460
+ "name": "DeviceIntegrityPlatform",
461
+ "slug": "deviceintegrityplatform",
462
+ "docs": "",
463
+ "types": [
464
+ {
465
+ "text": "'android'",
466
+ "complexTypes": []
467
+ },
468
+ {
469
+ "text": "'ios'",
470
+ "complexTypes": []
471
+ },
472
+ {
473
+ "text": "'web'",
474
+ "complexTypes": []
475
+ }
476
+ ]
477
+ },
478
+ {
479
+ "name": "AttestationFormat",
480
+ "slug": "attestationformat",
481
+ "docs": "",
482
+ "types": [
483
+ {
484
+ "text": "'apple-app-attest'",
485
+ "complexTypes": []
486
+ },
487
+ {
488
+ "text": "'google-play-integrity-standard'",
489
+ "complexTypes": []
490
+ }
491
+ ]
492
+ }
493
+ ],
494
+ "pluginConfigs": []
495
+ }
@@ -0,0 +1,218 @@
1
+ declare module '@capacitor/cli' {
2
+ interface PluginsConfig {
3
+ /**
4
+ * Device Integrity plugin configuration.
5
+ */
6
+ DeviceIntegrity?: DeviceIntegrityPluginConfig;
7
+ }
8
+ }
9
+ /**
10
+ * Capacitor config for the Device Integrity plugin.
11
+ */
12
+ export interface DeviceIntegrityPluginConfig {
13
+ /**
14
+ * Android only. Google Cloud project number used by the Play Integrity Standard API.
15
+ *
16
+ * Example:
17
+ * `plugins.DeviceIntegrity.cloudProjectNumber = '123456789012'`
18
+ */
19
+ cloudProjectNumber?: string;
20
+ }
21
+ export type DeviceIntegrityPlatform = 'android' | 'ios' | 'web';
22
+ export type AttestationFormat = 'apple-app-attest' | 'google-play-integrity-standard';
23
+ export interface DeviceIntegrityPlugin {
24
+ /**
25
+ * Returns the native integrity capabilities available on the current platform.
26
+ */
27
+ getCapabilities(): Promise<DeviceIntegrityCapabilities>;
28
+ /**
29
+ * Returns an Android Widevine-derived fingerprint.
30
+ *
31
+ * The default `fingerprint` is SHA-256 over the Widevine device unique ID and a salt.
32
+ * If `hashSalt` is not provided, Android uses the app package name as the salt.
33
+ *
34
+ * The raw Widevine ID is sensitive and is only returned as base64 when `includeRawId` is true.
35
+ */
36
+ getWidevineFingerprint(options?: WidevineFingerprintOptions): Promise<WidevineFingerprintResult>;
37
+ /**
38
+ * Prepares native attestation state and returns the key/provider handle.
39
+ *
40
+ * iOS: creates an App Attest key.
41
+ * Android: prepares a Play Integrity Standard token provider.
42
+ */
43
+ prepareAttestation(options?: PrepareAttestationOptions): Promise<PrepareAttestationResult>;
44
+ /**
45
+ * Creates a registration attestation token bound to a backend-issued challenge.
46
+ */
47
+ createAttestation(options: CreateAttestationOptions): Promise<AttestationTokenResult>;
48
+ /**
49
+ * Creates a request assertion token bound to a request payload.
50
+ */
51
+ createAssertion(options: CreateAssertionOptions): Promise<AttestationTokenResult>;
52
+ /**
53
+ * Creates an iOS DeviceCheck token for server-side fraud-state lookups.
54
+ */
55
+ getDeviceCheckToken(): Promise<DeviceCheckTokenResult>;
56
+ }
57
+ export interface DeviceIntegrityCapabilities {
58
+ /**
59
+ * Platform currently executing the plugin.
60
+ */
61
+ platform: DeviceIntegrityPlatform;
62
+ /**
63
+ * Android Widevine DRM support.
64
+ */
65
+ widevine: WidevineCapabilities;
66
+ /**
67
+ * iOS App Attest support.
68
+ */
69
+ appAttest: SupportStatus;
70
+ /**
71
+ * iOS DeviceCheck support.
72
+ */
73
+ deviceCheck: SupportStatus;
74
+ /**
75
+ * Android Play Integrity support.
76
+ */
77
+ playIntegrity: SupportStatus;
78
+ }
79
+ export interface WidevineCapabilities {
80
+ /**
81
+ * Whether the Widevine DRM scheme is supported by the device.
82
+ */
83
+ supported: boolean;
84
+ /**
85
+ * Whether the Widevine device unique ID can be read.
86
+ */
87
+ fingerprintAvailable: boolean;
88
+ /**
89
+ * Whether the Widevine security level property can be read.
90
+ */
91
+ securityLevelScanSupported: boolean;
92
+ }
93
+ export interface SupportStatus {
94
+ /**
95
+ * Whether the capability is available on the current device.
96
+ */
97
+ supported: boolean;
98
+ }
99
+ export interface WidevineFingerprintOptions {
100
+ /**
101
+ * Return the raw Widevine device unique ID as base64.
102
+ *
103
+ * Defaults to `false`.
104
+ */
105
+ includeRawId?: boolean;
106
+ /**
107
+ * Optional salt used to derive `fingerprint`.
108
+ *
109
+ * Android uses the app package name when omitted.
110
+ */
111
+ hashSalt?: string;
112
+ }
113
+ export interface WidevineFingerprintResult {
114
+ /**
115
+ * Always `android`.
116
+ */
117
+ platform: 'android';
118
+ /**
119
+ * Always `widevine`.
120
+ */
121
+ source: 'widevine';
122
+ /**
123
+ * Salted SHA-256 fingerprint for storing alongside a user record.
124
+ */
125
+ fingerprint: string;
126
+ /**
127
+ * Unsalted SHA-256 hash of the Widevine device unique ID.
128
+ */
129
+ widevineIdSha256: string;
130
+ /**
131
+ * Raw Widevine device unique ID encoded as base64.
132
+ *
133
+ * Returned only when `includeRawId` is true.
134
+ */
135
+ widevineIdBase64?: string;
136
+ /**
137
+ * Widevine security level when available, for example `L1` or `L3`.
138
+ */
139
+ securityLevel?: string;
140
+ /**
141
+ * DRM vendor when available.
142
+ */
143
+ vendor?: string;
144
+ /**
145
+ * DRM plugin version when available.
146
+ */
147
+ version?: string;
148
+ /**
149
+ * DRM plugin description when available.
150
+ */
151
+ description?: string;
152
+ }
153
+ export interface PrepareAttestationOptions {
154
+ /**
155
+ * Android only. Google Cloud project number for Play Integrity.
156
+ *
157
+ * Can be configured globally via `plugins.DeviceIntegrity.cloudProjectNumber`.
158
+ */
159
+ cloudProjectNumber?: string;
160
+ }
161
+ export interface PrepareAttestationResult {
162
+ /**
163
+ * iOS App Attest key ID or Android Play Integrity provider handle ID.
164
+ */
165
+ keyId: string;
166
+ /**
167
+ * Native attestation format used by the current platform.
168
+ */
169
+ format: AttestationFormat;
170
+ }
171
+ export interface CreateAttestationOptions {
172
+ /**
173
+ * Key/provider handle returned from `prepareAttestation()`.
174
+ */
175
+ keyId: string;
176
+ /**
177
+ * Backend-issued one-time challenge.
178
+ */
179
+ challenge: string;
180
+ /**
181
+ * Android only. Google Cloud project number for Play Integrity.
182
+ */
183
+ cloudProjectNumber?: string;
184
+ }
185
+ export interface CreateAssertionOptions {
186
+ /**
187
+ * Key/provider handle returned from `prepareAttestation()`.
188
+ */
189
+ keyId: string;
190
+ /**
191
+ * Backend-issued one-time request payload or nonce.
192
+ */
193
+ payload: string;
194
+ /**
195
+ * Android only. Google Cloud project number for Play Integrity.
196
+ */
197
+ cloudProjectNumber?: string;
198
+ }
199
+ export interface AttestationTokenResult {
200
+ /**
201
+ * Token/assertion that must be verified server-side.
202
+ */
203
+ token: string;
204
+ /**
205
+ * Key/provider handle used to create the token.
206
+ */
207
+ keyId: string;
208
+ /**
209
+ * Native attestation format used by the current platform.
210
+ */
211
+ format: AttestationFormat;
212
+ }
213
+ export interface DeviceCheckTokenResult {
214
+ /**
215
+ * iOS DeviceCheck token encoded as base64.
216
+ */
217
+ token: string;
218
+ }