Skip to content

Commit

Permalink
Merge pull request #138 from skyflowapi/SK-1379-verify-and-fix-all-re…
Browse files Browse the repository at this point in the history
…adme-broken-links

SK-1379 Fix broken links in README
  • Loading branch information
skyflow-vivek authored Jan 17, 2024
2 parents 0232f95 + 1c39a53 commit 56a14af
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 30 deletions.
46 changes: 31 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import { Skyflow, generateBearerToken } from 'skyflow-node';
```

### Service Account Bearer Token Generation
The [service account](https://github.com/skyflowapi/skyflow-node/tree/master/src/service-account) module uses a credentials file to generate service account tokens. See [API Authentication](https://docs.skyflow.com/developer-portal/getting-started/api-authentication/#step-1-create-a-service-account--assign-a-role) for instructions on creating a service account.
The [service account](https://github.com/skyflowapi/skyflow-node/tree/master/src/service-account) module uses a credentials file to generate service account tokens. See [API Authentication](https://docs.skyflow.com/api-authentication/#create-a-service-account) for instructions on creating a service account.

The token generated from this module is valid for 60 minutes and lets you make API calls to the Data API as well as the Management API based on the permissions of the service account.

Expand Down Expand Up @@ -544,21 +544,21 @@ Insert call [example](https://github.com/skyflowapi/skyflow-node/blob/master/sam

```javascript
const response = client.insert({
records: [{
fields: {
expiry_date: '12/2026',
card_number: '411111111111111',
},
table: 'cards',
}, ],
records: [{
fields: {
expiry_date: '12/2026',
card_number: '411111111111111',
},
table: 'cards',
}],
}, {
tokens: true,
upsert: [
{
table: 'cards',
column: 'card_number',
}
]
tokens: true,
upsert: [
{
table: 'cards',
column: 'card_number',
}
]
});

response.then(
Expand All @@ -573,6 +573,22 @@ response.then(
});
```

Samples Response:
```json
{
"records": [
{
"table": "cards",
"fields": {
"skyflow_id": "16419435-aa63-4823-aae7-19c6a2d6a19f",
"card_number": "f3907186-e7e2-466f-91e5-48e12c2bcbc1",
"cvv": "1989cb56-63da-4482-a2df-1f74cd0dd1a5",
},
}
]
}
```

Insert call [example](https://github.com/skyflowapi/skyflow-node/blob/master/samples/vault-api/InsertWithContinueOnError.ts) with contiueOnError support:

```javascript
Expand Down
40 changes: 25 additions & 15 deletions samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ Test the SDK by adding `VAULT-ID`, `VAULT-URL`, and `SERVICE-ACCOUNT` details in

## Prepare
- Install the Node SDK:

npm install skyflow-node
```bash
npm install skyflow-node
```

### Create the vault
1. In a browser, navigate to Skyflow Studio.
Expand All @@ -23,7 +24,7 @@ Test the SDK by adding `VAULT-ID`, `VAULT-URL`, and `SERVICE-ACCOUNT` details in

## The samples
### Detokenize
Detokenize a data token from the vault. Make sure the specified token is for data that exists in the vault. If you need a valid token, use [Insert.ts](Insert.ts) to insert the data, then use this data's token for detokenization.
Detokenize a data token from the vault. Make sure the specified token is for data that exists in the vault. If you need a valid token, use [Insert.ts](./vault-api/Insert.ts) to insert the data, then use this data's token for detokenization.
#### Configure
1. Replace **<VAULT_ID>** with **VAULT ID**
2. Replace **<VAULT_URL>** with **VAULT URL**.
Expand All @@ -35,8 +36,9 @@ Detokenize a data token from the vault. Make sure the specified token is for dat
8. Replace **<YOUR_CREDENTIAL_FILE>** with relative path of **SERVICE ACCOUNT CREDENTIAL FILE**.

#### Run the sample
ts-node Detokenize.ts
```bash
ts-node Detokenize.ts
```

### GetById
Get data using skyflow id.
Expand All @@ -49,8 +51,10 @@ Get data using skyflow id.
6. Replace **<YOUR_CREDENTIAL_FILE>** with relative path of **SERVICE ACCOUNT CREDENTIAL FILE**.
7. Replace **<TABLE_NAME>** with **credit_cards**.
#### Run the sample

ts-node GetById.ts
```bash
ts-node GetById.ts
```

### Insert
Insert data in the vault.
#### Configure
Expand All @@ -61,8 +65,10 @@ Insert data in the vault.
5. Replace **<FIELD_NAME>** with **column name**.
6. Replace **<VALUE>** with **valid value corresponding to column name**.
#### Run the sample
ts-node Insert.ts
```bash
ts-node Insert.ts
```

### InvokeConnection
Skyflow Connections is a gateway service that uses Skyflow's underlying tokenization capabilities to securely connect to first-party and third-party services. This way, your infrastructure is never directly exposed to sensitive data, and you offload security and compliance requirements to Skyflow.
#### Configure
Expand All @@ -74,22 +80,26 @@ Skyflow Connections is a gateway service that uses Skyflow's underlying tokeniza
6. Replace value of **requestBody** with your's request body content.

#### Run the sample

ts-node InvokeConnection.ts
```bash
ts-node InvokeConnection.ts
```

### Service account token generation
Generates a service account Bearer token using the file path of credentials.json.
#### Configure
1. Replace **<YOUR_CREDENTIAL_FILE_PATH>** with relative path of **SERVICE ACCOUNT CREDENTIAL FILE**.

#### Run the sample
ts-node TokenGenerationExample.ts
```bash
ts-node TokenGenerationExample.ts
```

### Generate Bearer Token From Credentails
Generates a service account bearer token using the JSON content of a credentials file.
#### Configure
1. Replace **credentials*** with json data of downloaded credentials file while creation Service account.

#### Run the sample

ts-node TokenGenerationUsingCredContent.ts
```bash
ts-node TokenGenerationUsingCredContent.ts
```

0 comments on commit 56a14af

Please sign in to comment.