skyflow-js 2.1.3 → 2.2.1
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 +60 -1
- package/dist/sdkNodeBuild/index.js +1 -1
- package/dist/sdkNodeBuild/index.js.gz +0 -0
- package/package.json +1 -1
- package/types/core/internal/index.d.ts +10 -0
- package/types/utils/constants.d.ts +4 -0
- package/types/utils/helpers/index.d.ts +4 -1
- package/types/utils/logs.d.ts +1 -0
package/README.md
CHANGED
|
@@ -344,7 +344,9 @@ const options = {
|
|
|
344
344
|
enableCopy: false, // Optional, enables the copy icon to collect elements to copy text to clipboard. Defaults to 'false').
|
|
345
345
|
format: String, // Optional, format for the element
|
|
346
346
|
translation: {}, // Optional, indicates the allowed data type value for format.
|
|
347
|
-
cardMetadata:{}
|
|
347
|
+
cardMetadata: {}, // Optional, metadata to control card number element behavior. (only applicable for CARD_NUMBER ElementType).
|
|
348
|
+
masking: true, // Optional, indicates whether the input should be masked. Defaults to 'false'.
|
|
349
|
+
maskingChar: '*', // Optional, character used for masking input when masking is enabled. Defaults to '*'.
|
|
348
350
|
};
|
|
349
351
|
```
|
|
350
352
|
|
|
@@ -421,6 +423,63 @@ const options = {
|
|
|
421
423
|
User input: "B1234121234"
|
|
422
424
|
Value displayed in INPUT_FIELD: "AB 12-341-2123"
|
|
423
425
|
|
|
426
|
+
`masking` : A boolean value for whether to mask the input of the element. When masking is enabled, user input will be replaced with a masking character.
|
|
427
|
+
The default masking character is `*`, but you can customize masking character using the maskingChar property.
|
|
428
|
+
|
|
429
|
+
`maskingChar`: A single character used to mask the input when masking is enabled. Defaults to `*`, but can be customized to any character of your choice.
|
|
430
|
+
|
|
431
|
+
Collect Element Options examples with masking:
|
|
432
|
+
|
|
433
|
+
Example for CVV:
|
|
434
|
+
```js
|
|
435
|
+
const options = {
|
|
436
|
+
required: true,
|
|
437
|
+
enableCopy: false,
|
|
438
|
+
masking: true,
|
|
439
|
+
maskingChar: '•',
|
|
440
|
+
}
|
|
441
|
+
```
|
|
442
|
+
User input: "1234"
|
|
443
|
+
Value displayed in CVV: "••••"
|
|
444
|
+
|
|
445
|
+
Example for CARDHOLDER_NAME:
|
|
446
|
+
```js
|
|
447
|
+
const options = {
|
|
448
|
+
required: true,
|
|
449
|
+
enableCopy: false,
|
|
450
|
+
masking: true,
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
User input: "John Doe"
|
|
454
|
+
Value displayed in CARDHOLDER_NAME: "********"
|
|
455
|
+
|
|
456
|
+
Example for CARD_NUMBER:
|
|
457
|
+
```js
|
|
458
|
+
const options = {
|
|
459
|
+
required: true,
|
|
460
|
+
enableCopy: false,
|
|
461
|
+
masking: true,
|
|
462
|
+
maskingChar: '#'
|
|
463
|
+
}
|
|
464
|
+
```
|
|
465
|
+
User input: "4111 1111 1111 1111"
|
|
466
|
+
Value displayed in CARD_NUMBER: "#### #### #### ####"
|
|
467
|
+
|
|
468
|
+
Example for PIN:
|
|
469
|
+
```js
|
|
470
|
+
const options = {
|
|
471
|
+
required: true,
|
|
472
|
+
enableCopy: false,
|
|
473
|
+
masking: true,
|
|
474
|
+
maskingChar: '&'
|
|
475
|
+
}
|
|
476
|
+
```
|
|
477
|
+
User input: "98364721"
|
|
478
|
+
Value displayed in PIN: "&&&&&&&&"
|
|
479
|
+
|
|
480
|
+
**Note**:
|
|
481
|
+
- Unmasked data will be stored in the vault.
|
|
482
|
+
|
|
424
483
|
Once the Element object and options has been defined, add it to the container using the `create(element, options)` method as shown below. The `element` param takes a Skyflow Element object and options as defined above:
|
|
425
484
|
|
|
426
485
|
```javascript
|