skyflow-js 1.32.0 → 1.33.0-beta.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/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.32.0] - 2023-10-26
6
+ ### Added
7
+ - `tokens` support in Get interface
8
+
4
9
  ## [1.31.1] - 2023-10-17
5
10
  ### Fixed
6
11
  - Expiration-year max-length based on format.
package/README.md CHANGED
@@ -1809,12 +1809,19 @@ The sample response:
1809
1809
  ```
1810
1810
 
1811
1811
  - ### Using Skyflow ID's or Unique Column Values
1812
- You can retrieve data from the vault with the get(records) method using either Skyflow IDs or unique column values.
1812
+ You can retrieve data from the vault with the `get(records, options)` method using either Skyflow IDs or unique column values.
1813
1813
 
1814
1814
  The records parameter accepts a JSON object that contains an array of either Skyflow IDs or unique column names and values.
1815
1815
 
1816
- Note: You can use either Skyflow IDs or unique values to retrieve records. You can't use both at the same time.
1816
+ The options is an optional `IGetOptions` object that retrieves the tokens for SkyflowIDs.
1817
+
1818
+ Notes:
1817
1819
 
1820
+ - You can use either Skyflow IDs or unique values to retrieve records. You can't use both at the same time.
1821
+ - `options` parameter is applicable only for retrieving tokens using Skyflow ID.
1822
+ - You can't pass options along with the redaction type.
1823
+ - `tokens` defaults to false.
1824
+
1818
1825
  Skyflow.RedactionTypes accepts four values:
1819
1826
  - `PLAIN_TEXT`
1820
1827
  - `MASKED`
@@ -1939,6 +1946,46 @@ Sample response:
1939
1946
  }
1940
1947
  ```
1941
1948
 
1949
+ [Example usage (Fetch tokens using Skyflow IDs)](https://github.com/skyflowapi/skyflow-js/blob/master/samples/using-script-tag/get-pure-js.html)
1950
+ ```javascript
1951
+ skyflow.get({
1952
+ records: [
1953
+ {
1954
+ ids: [
1955
+ "f8d8a622-b557-4c6b-a12c-c5ebe0b0bfd9",
1956
+ "da26de53-95d5-4bdb-99db-8d8c66a35ff9"
1957
+ ],
1958
+ table: "cards",
1959
+ },
1960
+ ],
1961
+ }, { tokens: true });
1962
+ ```
1963
+ Sample response:
1964
+ ```javascript
1965
+ {
1966
+ "records": [
1967
+ {
1968
+ "fields": {
1969
+ "card_id": "f689e421-4cf8-4438-8dbd-cc8e7654b7d9",
1970
+ "expiry_date": "d9ef1cb8-5c22-48b0-b769-64ac20ccee01",
1971
+ "fullname": "37480f82-d237-4efc-a06a-ebe57121be06",
1972
+ "id": "f8d2-b557-4c6b-a12c-c5ebfd9"
1973
+ },
1974
+ "table": "cards"
1975
+ },
1976
+ {
1977
+ "fields": {
1978
+ "card_id": "d794b64c-e283-4fb8-8eef-9f6710730b69",
1979
+ "expiry_date": "ff848fc3-a093-4ed4-9414-877b74a33111",
1980
+ "fullname": "dfb6c247-3ee6-4fd2-8d1e-19d8e11c25ce",
1981
+ "id": "da53-95d5-4bdb-99db-8d8c5ff9"
1982
+ },
1983
+ "table": "cards"
1984
+ }
1985
+ ]
1986
+ }
1987
+ ```
1988
+
1942
1989
  ## Using Skyflow Elements to reveal data
1943
1990
 
1944
1991
  Skyflow Elements can be used to securely reveal data in a browser without exposing your front end to the sensitive data. This is great for use cases like card issuance where you may want to reveal the card number to a user without increasing your PCI compliance scope.