From 65c93952475edfb34d6c1fffd9e13dcd588bf26b Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Mon, 19 Oct 2026 17:02:36 +0000 Subject: [PATCH] docs: fix JavaScript SDK documentation accuracy issues --- packages/skyflow-flowvault-js/README.md | 42 ++++---- packages/skyflow-js/README.md | 121 ++++++++++++------------ packages/skyflow-js/samples/README.md | 38 ++++---- 3 files changed, 100 insertions(+), 101 deletions(-) diff --git a/packages/skyflow-flowvault-js/README.md b/packages/skyflow-flowvault-js/README.md index 54ad4382..8cf74688 100644 --- a/packages/skyflow-flowvault-js/README.md +++ b/packages/skyflow-flowvault-js/README.md @@ -106,13 +106,13 @@ const getBearerToken = () => { const response = JSON.parse(Http.responseText); resolve(response.accessToken); } else { - reject('Error occured'); + reject('Error occurred'); } } }; Http.onerror = error => { - reject('Error occured'); + reject('Error occurred'); }; const url = 'https://api.acmecorp.com/skyflowToken'; @@ -222,8 +222,8 @@ A Skyflow collect Element is defined as shown below: ```javascript const collectElement = { - tableName: 'string', // Optional, the table this data belongs to. - column: 'string', // Optional, the column into which this data should be inserted. + tableName: 'string', // Required, the table this data belongs to. + column: 'string', // Required, the column into which this data should be inserted. type: Skyflow.ElementType, // Skyflow.ElementType enum. inputStyles: {}, // Optional, styles that should be applied to the form element. labelStyles: {}, // Optional, styles that will be applied to the label of the collect element. @@ -250,7 +250,7 @@ The `inputStyles` field accepts a style object which consists of CSS properties Styles are specified with [JSS](https://cssinjs.org/?v=v10.7.1). -An example of a inputStyles object: +An example of an inputStyles object: ```javascript inputStyles: { base: { @@ -344,7 +344,7 @@ Along with CollectElement we can define other options which takes a object of op const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether a card icon should be enabled (only applicable for CARD_NUMBER ElementType). - enableCopy: false, // Optional, enables the copy icon to collect elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon to collect elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {}, // Optional, indicates the allowed data type value for format. cardMetadata: {}, // Optional, metadata to control card number element behavior. (only applicable for CARD_NUMBER ElementType). @@ -487,8 +487,8 @@ Once the Element object and options has been defined, add it to the container us ```javascript const collectElement = { - tableName: 'string', // Optional, the table this data belongs to. - column: 'string', // Optional, the column into which this data should be inserted. + tableName: 'string', // Required, the table this data belongs to. + column: 'string', // Required, the column into which this data should be inserted. type: Skyflow.ElementType, // Skyflow.ElementType enum. inputStyles: {}, // Optional, styles that should be applied to the form element. labelStyles: {}, // Optional, styles that will be applied to the label of the collect element. @@ -502,7 +502,7 @@ const collectElement = { const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether card icon should be enabled (only applicable for CARD_NUMBER ElementType). - enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {}, // Optional, indicates the allowed data type value for format. }; @@ -817,7 +817,7 @@ const binLookup = (bin) => { const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether a card icon should be enabled (only applicable for CARD_NUMBER ElementType). - enableCopy: false, // Optional, enables the copy icon to collect elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon to collect elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {}, // Optional, indicates the allowed data type value for format. cardMetadata: {}, // Optional, metadata to control card number element behavior. (only applicable for CARD_NUMBER ElementType). @@ -874,7 +874,7 @@ const collectElement = { const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether the element needs a card icon (only applicable for CARD_NUMBER ElementType). - enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {}, // Optional, indicates the allowed data type value for format. }; @@ -1557,8 +1557,8 @@ Composable Elements use the following schema: ```javascript const composableElement = { - tableName: 'string', // Optional. The table this data belongs to. - column: 'string', // Optional. The column this data belongs to. + tableName: 'string', // Required, the table this data belongs to. + column: 'string', // Required, the column this data belongs to. type: Skyflow.ElementType, // Skyflow.ElementType enum. inputStyles: {}, // Optional. Styles applied to the form element. labelStyles: {}, // Optional. Styles for the label of the collect element. @@ -1666,7 +1666,7 @@ const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false' enableCardIcon: true, // Optional, indicates whether card icon should be enabled (only applicable for CARD_NUMBER ElementType) format: String, // Optional, format for the element (only applicable currently for EXPIRATION_DATE ElementType), - enableCopy: false // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false') + enableCopy: false // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false' } ``` @@ -1693,8 +1693,8 @@ Once you define the Element object and options, add it to the container using th ```javascript const composableElement = { - tableName: 'string', // Optional, the table this data belongs to. - column: 'string', // Optional, the column into which this data should be inserted. + tableName: 'string', // Required, the table this data belongs to. + column: 'string', // Required, the column into which this data should be inserted. type: Skyflow.ElementType, // Skyflow.ElementType enum. inputStyles: {}, // Optional, styles that should be applied to the form element. labelStyles: {}, // Optional, styles that will be applied to the label of the collect element. @@ -1709,7 +1709,7 @@ const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether card icon should be enabled (only applicable for CARD_NUMBER ElementType). format: String, // Optional, format for the element (only applicable currently for EXPIRATION_DATE ElementType). - enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'. }; const element = container.create(composableElement, options); @@ -2138,7 +2138,7 @@ Note: To control the redaction applied to revealed data, pass `tokenGroupRedacti The `inputStyles`, `labelStyles` and `errorTextStyles` parameters accepts a styles object as described in the [previous section](#step-2-create-a-collect-element) for collecting data. But for reveal element, `inputStyles` accepts only `base` variant, `copyIcon` and `global` style objects. -An example of a inputStyles object: +An example of an inputStyles object: ```javascript inputStyles: { @@ -2186,7 +2186,7 @@ errorTextStyles: { Along with RevealElementInput, you can define other options in the RevealElementOptions object as described below: ```js const options = { - enableCopy: false, // Optional, enables the copy icon to reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon to reveal elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {} // Optional, indicates the allowed data type value for format. } @@ -2617,7 +2617,7 @@ Note: Redaction is no longer set per element. To control the redaction applied t The `inputStyles`, `labelStyles` and `errorTextStyles` parameters accepts a styles object as described in the [previous section](#step-2-create-a-collect-element) for collecting data. But for reveal element, `inputStyles` accepts only `base` variant, `copyIcon` and `global` style objects. -An example of a inputStyles object: +An example of an inputStyles object: ```javascript inputStyles: { @@ -2665,7 +2665,7 @@ errorTextStyles: { Along with RevealElementInput, you can define other options in the RevealElementOptions object as described below: ```js const options = { - enableCopy: false, // Optional, enables the copy icon to reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon to reveal elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {} // Optional, indicates the allowed data type value for format. } diff --git a/packages/skyflow-js/README.md b/packages/skyflow-js/README.md index c9677674..0bf37fae 100644 --- a/packages/skyflow-js/README.md +++ b/packages/skyflow-js/README.md @@ -76,13 +76,13 @@ const getBearerToken = () => { const response = JSON.parse(Http.responseText); resolve(response.accessToken); } else { - reject('Error occured'); + reject('Error occurred'); } } }; Http.onerror = error => { - reject('Error occured'); + reject('Error occurred'); }; const url = 'https://api.acmecorp.com/skyflowToken'; @@ -300,7 +300,7 @@ The `inputStyles` field accepts a style object which consists of CSS properties Styles are specified with [JSS](https://cssinjs.org/?v=v10.7.1). -An example of a inputStyles object: +An example of an inputStyles object: ```javascript inputStyles: { base: { @@ -375,7 +375,7 @@ errorTextStyles: { }, ``` -Finally, the `type` field takes a Skyflow ElementType. Each type applies the appropriate regex and validations to the form element. There are currently 8 types: +Finally, the `type` field takes a Skyflow ElementType. Each type applies the appropriate regex and validations to the form element. There are currently 10 types: - `CARDHOLDER_NAME` - `CARD_NUMBER` - `EXPIRATION_DATE` @@ -385,6 +385,7 @@ Finally, the `type` field takes a Skyflow ElementType. Each type applies the app - `INPUT_FIELD` - `PIN` - `FILE_INPUT` +- `MULTI_FILE_INPUT` The `INPUT_FIELD` type is a custom UI element without any built-in validations. For information on validations, see [validations](#validations). @@ -395,7 +396,7 @@ Along with CollectElement we can define other options which takes a object of op const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether a card icon should be enabled (only applicable for CARD_NUMBER ElementType). - enableCopy: false, // Optional, enables the copy icon to collect elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon to collect elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {}, // Optional, indicates the allowed data type value for format. cardMetadata: {}, // Optional, metadata to control card number element behavior. (only applicable for CARD_NUMBER ElementType). @@ -553,7 +554,7 @@ const collectElement = { const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether card icon should be enabled (only applicable for CARD_NUMBER ElementType). - enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {}, // Optional, indicates the allowed data type value for format. }; @@ -634,7 +635,7 @@ const container = skyflowClient.container(Skyflow.ContainerType.COLLECT); const element = container.create({ table: 'cards', column: 'cardNumber', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -860,7 +861,7 @@ const binLookup = (bin) => { const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether a card icon should be enabled (only applicable for CARD_NUMBER ElementType). - enableCopy: false, // Optional, enables the copy icon to collect elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon to collect elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {}, // Optional, indicates the allowed data type value for format. cardMetadata: {}, // Optional, metadata to control card number element behavior. (only applicable for CARD_NUMBER ElementType). @@ -917,7 +918,7 @@ const collectElement = { const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether the element needs a card icon (only applicable for CARD_NUMBER ElementType). - enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {}, // Optional, indicates the allowed data type value for format. }; @@ -1606,7 +1607,7 @@ container.uploadFiles(); ``` ### File upload limitations: -- Only non-executable file are allowed to be uploaded. +- Only non-executable files are allowed to be uploaded. - Files must have a maximum size of 32 MB - File columns can't enable tokenization, redaction, or arrays. - Re-uploading a file overwrites previously uploaded data. @@ -1623,7 +1624,7 @@ const element = container.create({ table: 'pii_fields', column: 'file', skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -1679,7 +1680,7 @@ const collectContainer = skyflowClient.container(Skyflow.ContainerType.COLLECT); const cardNumberElement = collectContainer.create({ table: 'newTable', column: 'card_number', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -1706,7 +1707,7 @@ const fileElement = collectContainer.create({ table: 'newTable', column: 'file', skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -1769,7 +1770,7 @@ const collectContainer = skyflowClient.container(Skyflow.ContainerType.COLLECT); const cardNumberElement = collectContainer.create({ table: 'newTable', column: 'card_number', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -1794,7 +1795,7 @@ const fileElement = collectContainer.create({ table: 'newTable', column: 'file', skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2015,7 +2016,7 @@ const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false' enableCardIcon: true, // Optional, indicates whether card icon should be enabled (only applicable for CARD_NUMBER ElementType) format: String, // Optional, format for the element (only applicable currently for EXPIRATION_DATE ElementType), - enableCopy: false // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false') + enableCopy: false // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false' } ``` @@ -2058,7 +2059,7 @@ const options = { required: false, // Optional, indicates whether the field is marked as required. Defaults to 'false'. enableCardIcon: true, // Optional, indicates whether card icon should be enabled (only applicable for CARD_NUMBER ElementType). format: String, // Optional, format for the element (only applicable currently for EXPIRATION_DATE ElementType). - enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false'. }; const element = container.create(composableElement, options); @@ -2489,7 +2490,7 @@ composableContainer.uploadFiles(); ``` ### File upload limitations: -- Only non-executable file are allowed to be uploaded. +- Only non-executable files are allowed to be uploaded. - Files must have a maximum size of 32 MB - File columns can't enable tokenization, redaction, or arrays. - Re-uploading a file overwrites previously uploaded data. @@ -2509,7 +2510,7 @@ const element = container.create({ table: 'pii_fields', column: 'file', skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2568,7 +2569,7 @@ const collectContainer = skyflowClient.container(Skyflow.ContainerType.COMPOSABL const cardNumberElement = collectContainer.create({ table: 'newTable', column: 'card_number', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2595,7 +2596,7 @@ const fileElement = collectContainer.create({ table: 'newTable', column: 'file', skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2660,7 +2661,7 @@ const collectContainer = skyflowClient.container(Skyflow.ContainerType.COMPOSABL const cardNumberElement = collectContainer.create({ table: 'newTable', column: 'card_number', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2685,7 +2686,7 @@ const fileElement = collectContainer.create({ table: 'newTable', column: 'file', skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2790,7 +2791,7 @@ Note: ### File upload limitations: -- Only non-executable file are allowed to be uploaded. +- Only non-executable files are allowed to be uploaded. - Files have a default maximum size of 32 MB per file. This limit is configurable using the `maxFileSize` option. - Up to 4 files can be uploaded at a time by default. This limit is configurable using the `maxFileCount` option. - File columns can't enable tokenization, redaction, or arrays. @@ -2811,7 +2812,7 @@ const element = container.create({ table: 'pii_fields', column: 'file', skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2879,7 +2880,7 @@ const collectContainer = skyflowClient.container(Skyflow.ContainerType.COMPOSABL const cardNumberElement = collectContainer.create({ table: 'newTable', column: 'card_number', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2908,7 +2909,7 @@ const fileElement = collectContainer.create({ table: 'newTable', column: 'file', skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2973,7 +2974,7 @@ const collectContainer = skyflowClient.container(Skyflow.ContainerType.COMPOSABL const cardNumberElement = collectContainer.create({ table: 'newTable', column: 'card_number', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -2998,7 +2999,7 @@ const fileElement = collectContainer.create({ table: 'newTable', column: 'file', skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882', - inputstyles: { + inputStyles: { base: { color: '#1d1d1d', }, @@ -3086,17 +3087,17 @@ const records = { ], }; -Note: If you do not provide a redaction type, RedactionType.PLAIN_TEXT is the default. - -skyflow.detokenize(records); +skyflowClient.detokenize(records); ``` +Note: If you do not provide a redaction type, `RedactionType.PLAIN_TEXT` is the default. + An [example](https://github.com/skyflowapi/skyflow-js/blob/main/packages/skyflow-js/samples/using-script-tag/pure-js.html) of a detokenize call: ```javascript -skyflow.detokenize({ +skyflowClient.detokenize({ records: [ { - token: ', + token: '', }, { token: '', @@ -3180,7 +3181,7 @@ data = { [Example usage (Skyflow IDs)](https://github.com/skyflowapi/skyflow-js/blob/main/packages/skyflow-js/samples/using-script-tag/get-pure-js.html) ```javascript -skyflow.get({ +skyflowClient.get({ records: [ { ids: ["f8d8a622-b557-4c6b-a12c-c5ebe0b0bfd9"], @@ -3225,7 +3226,7 @@ Example response [Example usage (Unique column values)](https://github.com/skyflowapi/skyflow-js/blob/main/packages/skyflow-js/samples/using-script-tag/get-pure-js.html) ```javascript -skyflow.get({ +skyflowClient.get({ records: [ { table: "cards", @@ -3264,7 +3265,7 @@ Sample response: [Example usage (Fetch tokens using Skyflow IDs)](https://github.com/skyflowapi/skyflow-js/blob/main/packages/skyflow-js/samples/using-script-tag/get-pure-js.html) ```javascript -skyflow.get({ +skyflowClient.get({ records: [ { ids: [ @@ -3333,7 +3334,7 @@ Note: If you don't provide a redaction type, RedactionType.PLAIN_TEXT will apply The `inputStyles`, `labelStyles` and `errorTextStyles` parameters accepts a styles object as described in the [previous section](#step-2-create-a-collect-element) for collecting data. But for reveal element, `inputStyles` accepts only `base` variant, `copyIcon` and `global` style objects. -An example of a inputStyles object: +An example of an inputStyles object: ```javascript inputStyles: { @@ -3381,7 +3382,7 @@ errorTextStyles: { Along with RevealElementInput, you can define other options in the RevealElementOptions object as described below: ```js const options = { - enableCopy: false, // Optional, enables the copy icon to reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon to reveal elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {} // Optional, indicates the allowed data type value for format. } @@ -3658,7 +3659,7 @@ const fileElement = { ``` The inputStyles and errorTextStyles parameters accept a styles object as described in the [previous section](https://github.com/skyflowapi/skyflow-js#step-2-create-a-collect-element) for collecting data. But for render file elements, inputStyles accepts only base variant, global style objects. -An example of a inputStyles object: +An example of an inputStyles object: ```javascript inputStyles: { @@ -3764,7 +3765,7 @@ fetch("") { "skyflow_id": "", "column": "file" - }, + } ] } ``` @@ -3933,7 +3934,7 @@ Note: If you don't provide a redaction type, RedactionType.PLAIN_TEXT will apply The `inputStyles`, `labelStyles` and `errorTextStyles` parameters accepts a styles object as described in the [previous section](#step-2-create-a-collect-element) for collecting data. But for reveal element, `inputStyles` accepts only `base` variant, `copyIcon` and `global` style objects. -An example of a inputStyles object: +An example of an inputStyles object: ```javascript inputStyles: { @@ -3981,7 +3982,7 @@ errorTextStyles: { Along with RevealElementInput, you can define other options in the RevealElementOptions object as described below: ```js const options = { - enableCopy: false, // Optional, enables the copy icon to reveal elements to copy text to clipboard. Defaults to 'false'). + enableCopy: false, // Optional, enables the copy icon to reveal elements to copy text to clipboard. Defaults to 'false'. format: String, // Optional, format for the element translation: {} // Optional, indicates the allowed data type value for format. } @@ -4279,7 +4280,7 @@ const fileElement = { ``` The inputStyles and errorTextStyles parameters accept a styles object as described in the [previous section](https://github.com/skyflowapi/skyflow-js#step-2-create-a-collect-element) for collecting data. But for render file elements, inputStyles accepts only base variant, global style objects. -An example of a inputStyles object: +An example of an inputStyles object: ```javascript inputStyles: { @@ -4479,18 +4480,20 @@ fetch("") ## Deleting data from the vault -To delete data from the vault, use the `delete(records, options?)` method of the Skyflow client. The `records` parameter takes an array of records to delete in the following format. The `options` parameter is optional and takes an object of deletion parameters. Currently, there are no supported deletion parameters. +To delete data from the vault, use the `delete(records, options?)` method of the Skyflow client. The `records` parameter takes an object with a `records` array of records to delete, in the following format. The `options` parameter is optional and takes an object of deletion parameters. Currently, there are no supported deletion parameters. ```javascript -const records = [ - { - id: "", // skyflow id of the record to delete - table: "" // Table from which the record is to be deleted - }, - { - // ...additional records here - }, -], +const records = { + records: [ + { + id: "", // skyflow id of the record to delete + table: "" // Table from which the record is to be deleted + }, + { + // ...additional records here + }, + ], +}; skyflowClient.delete(records); ``` @@ -4519,11 +4522,11 @@ A sample response: "records": [ { "skyflow_id": "29ebda8d-5272-4063-af58-15cc674e332b", - "deleted": true, + "deleted": true }, { - "skyflow_id": "29ebda8d-5272-4063-af58-15cc674e332b", - "deleted": true, + "skyflow_id": "d5f4b926-7b1a-41df-8fac-7950d2cbd923", + "deleted": true } ] } @@ -4533,7 +4536,7 @@ A sample response: Add custom network error messages to a container with the `setError` method. -`setError(ErrorMessages: Record)` sets the error text for the different network errors types. When this method is triggered, all the errors present in the error response are overridden with the specified custom error message. This error is sent on the collect or upload file call on the same container. +`setError(ErrorMessages: Partial>)` sets the error text for the different network errors types. When this method is triggered, all the errors present in the error response are overridden with the specified custom error message. This error is sent on the collect or upload file call on the same container. ### Sample code snippet for setError on collect container ```javascript @@ -4576,7 +4579,7 @@ container "code":0, "description":"You appear to be offline. Please check your internet connection.", "type":"OFFLINE" - }, + } } ``` diff --git a/packages/skyflow-js/samples/README.md b/packages/skyflow-js/samples/README.md index 4392b354..3a41c050 100644 --- a/packages/skyflow-js/samples/README.md +++ b/packages/skyflow-js/samples/README.md @@ -18,11 +18,11 @@ Samples come in three flavors — [`using-script-tag/`](using-script-tag) (loads ## Get Started ### Create the vault -1. Sign in to Skyflow Studio.In a browser, navigate to Skyflow Studio. +1. Sign in to Skyflow Studio. In a browser, navigate to Skyflow Studio. 2. Create a vault by clicking **Create Vault** > **Start With a Template** > **Quickstart vault**. -3. Under Quickstart, click Create.Once the vault is created, click the gear icon and select **Edit Vault Details**. +3. Under Quickstart, click Create. Once the vault is created, click the gear icon and select **Edit Vault Details**. -To run the following commands, you'll need to retrieve your vault-specific values, **** and ****. Find your vault values by clicking the vault menu icon > Edit vault details.Note your **Vault URL** and **Vault ID** values, then click Cancel. You'll need these later. +To run the following commands, you'll need to retrieve your vault-specific values, **** and ****. Find your vault values by clicking the vault menu icon > Edit vault details. Note your **Vault URL** and **Vault ID** values, then click Cancel. You'll need these later. ### Create a service account @@ -187,18 +187,17 @@ This sample shows you how to use event listeners with Skyflow Elements. 1. open [`index.js`](using-npm/collect-element-listeners/src/index.js) 2. Replace **** and **VAULT URL** with your vault-specific values. 3. Replace **** with `http://localhost:3000/` -Run the following command. +#### Run the following command. - cd using-npm/collect-element-listeners/src - npx live-server index.html --port=8000 -From your browser, navigate to `http://localhost:8000/` to view the page. + npm start +From your browser, navigate to the URL printed by parcel to view the page. ### skyflow-elements This sample shows you how to collect and reveal data with Skyflow Elements. #### Run the following command. - cd using-npm/custom-validations + cd using-npm/skyflow-elements npm i #### Configure 1. open [`index.js`](using-npm/skyflow-elements/src/index.js) @@ -206,16 +205,15 @@ This sample shows you how to collect and reveal data with Skyflow Elements. 3. Replace **** with `http://localhost:3000/` #### Run the following command. - cd using-npm/custom-validations/src - npx live-server index.html --port=8000 -From your browser, navigate to `http://localhost:8000/` to view the page. + npm start +From your browser, navigate to the URL printed by parcel to view the page. ### custom-validations This sample shows you how to create custom validation when using Skyflow Elements. #### Run the following command. - cd using-npm/pure-js + cd using-npm/custom-validations npm i #### Configure 1. open [`index.js`](using-npm/custom-validations/src/index.js) @@ -223,24 +221,22 @@ This sample shows you how to create custom validation when using Skyflow Element 3. Replace **** with `http://localhost:3000/` #### Run the following command. - cd using-npm/pure-js/src - npx live-server index.html --port=8000 -From your browser, navigate to`http://localhost:8000/` to view the page. + npm start +From your browser, navigate to the URL printed by parcel to view the page. ### Record Insertion This sample shows you how to insert data into your vault. #### Run the following command. - cd using-npm/pure-js - npm i + cd using-npm/pure-js + npm i #### Configure -1. open [`index.js`](using-npm/collect-element-listeners/src/index.js) +1. open [`index.js`](using-npm/pure-js/src/index.js) 2. Replace **** and **VAULT URL** with your vault-specific values. 3. Replace **** with `http://localhost:3000/` #### Run the following command. - cd using-npm/skyflow-elements/src - npx live-server index.html --port=8000 -From your browser, navigate to `http://localhost:8000/` to view the page. + npm start +From your browser, navigate to the URL printed by parcel to view the page.