Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/advanced_initialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const tertiaryVaultConfig: VaultConfig = {

const skyflowConfig: SkyflowConfig = {
vaultConfigs: [primaryVaultConfig, secondaryVaultConfig, tertiaryVaultConfig], // Add the primary, secondary and tertiary vault configurations.
skyflowCredentials: skyflowCredentials, // Add JSON-formatted credentials if applicable.
skyflowCredentials: { credentialsString: credentialsString }, // Use the stringified JSON credentials as the shared fallback credentials.
Comment thread
promptless[bot] marked this conversation as resolved.
Resolved
logLevel: LogLevel.INFO, // Recommended to use LogLevel.ERROR in production environment.
};

Expand Down
2 changes: 1 addition & 1 deletion docs/api_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Provide **exactly one** file source: `setFileObject`, `setFilePath`, or `setBase

| Setter | Type | Description |
|---|---|---|
| `setSkyflowId(id)` | `string` | **Required.** Skyflow ID of the record to attach the file to. |
| `setSkyflowId(id)` | `string` | Skyflow ID of the record to attach the file to. Omit to upload the file to a new record. |
Comment thread
promptless[bot] marked this conversation as resolved.
Resolved
| `setFileObject(file)` | `File` | In-memory `File` object. |
| `setFilePath(path)` | `string` | Path to a file on disk. Requires Node.js v20+. |
| `setBase64(data)` | `string` | Base64-encoded file content. Use with `setFileName`. |
Expand Down
22 changes: 14 additions & 8 deletions docs/migrate_to_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

This guide outlines the steps required to migrate the Skyflow Node SDK from version 1 (V1) to version 2 (V2).

> [!IMPORTANT]
> V1 is in maintenance mode and will reach End of Life on October 31, 2026. Migrate to V2 before that date.
Comment thread
promptless[bot] marked this conversation as resolved.
Resolved

## Authentication

In V2, multiple authentication options have been introduced. You can now provide credentials in the following ways:
Expand All @@ -28,6 +31,8 @@ const auth = function () {

#### v2 Authentication: Credentials object

**Option 1: API key**

```typescript
import { Credentials } from 'skyflow-node';

Expand All @@ -36,24 +41,25 @@ const credentials: Credentials = {
};
```

// Option 2: Environment Variables (Recommended)
// Set SKYFLOW_CREDENTIALS in your environment
**Option 2: Environment variable (recommended)**

Set `SKYFLOW_CREDENTIALS` in your environment. The SDK reads it automatically when no credentials are passed.
Comment thread
promptless[bot] marked this conversation as resolved.
Resolved

// Option 3: Credentials File
**Option 3: Credentials file**

```typescript
const credentials: Credentials = { path: "<YOUR_CREDENTIALS_FILE_PATH>" };
```

// Option 4: Stringified JSON
**Option 4: Stringified JSON**

```typescript
const credentials: Credentials = {
credentialsString: JSON.stringify(process.env.SKYFLOW_CREDENTIALS),
};
```

// Option 5: Bearer Token
**Option 5: Bearer token**

```typescript
const credentials: Credentials = { token: "<YOUR_BEARER_TOKEN>" };
Expand Down Expand Up @@ -124,10 +130,10 @@ const skyflowClient: Skyflow = new Skyflow(skyflowConfig);

### Request and Response Structure

In v2, with the introduction of TypeScript support, you can now pass an **InsertRequest** of type **InsertRequest**. This request requires:
In v2, with the introduction of TypeScript support, you can now pass an **InsertRequest** of type **InsertRequest**. Its constructor takes two positional arguments:

- **`tableName`**: The name of the table.
- **`insertData`**: An array of objects containing the data to be inserted
- **`table`**: The name of the table.
Comment thread
promptless[bot] marked this conversation as resolved.
Resolved
- **`data`**: An array of objects containing the data to insert.

The response will be of type InsertResponse, which contains insertedFields and errors.

Expand Down
14 changes: 7 additions & 7 deletions skyvault/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The Skyflow SDK enables you to connect to your Skyflow Vault(s) to securely hand

## Installation

Requires Node v12.22.12 and above.
Requires Node.js v18 and above. File operations (`uploadFile`, `deidentifyFile`) require Node.js v20 and above.

```sh
npm install skyflow-node
Expand Down Expand Up @@ -304,7 +304,7 @@ For all `InsertOptions` setters and `TokenMode` values, see [InsertOptions](../d

Convert tokens back into plaintext values (or masked values) using the `.detokenize()` method. Detokenization accepts tokens and returns values.

Create a detokenization request with the [`DetokenizeRequest`](../docs/api_reference.md#detokenizerequest) class, which requires a list of tokens and column groups as input.
Create a detokenization request with the [`DetokenizeRequest`](../docs/api_reference.md#detokenizerequest) class, which requires a list of tokens as input, each with an optional redaction type.

Provide optional parameters such as the redaction type and the option to continue on error.

Expand Down Expand Up @@ -1084,7 +1084,7 @@ A `deidentifyFile` run that was accepted but failed while processing does not th

## Connections

Securely send and receive data between your systems and first- or third-party services using Skyflow Connections, a gateway service that uses tokenization. The [connections](https://github.com/skyflowapi/skyflow-node/tree/v2/src/vault/controller/connections) module invokes both inbound and outbound connections.
Securely send and receive data between your systems and first- or third-party services using Skyflow Connections, a gateway service that uses tokenization. The [connections](https://github.com/skyflowapi/skyflow-node/tree/main/skyvault/src/vault/controller/connections) module invokes both inbound and outbound connections.

- **Inbound connections**: Act as intermediaries between your client and server, tokenizing sensitive data before it reaches your backend, ensuring downstream services handle only tokenized data.
- **Outbound connections**: Enable secure extraction of data from the vault and transfer it to third-party services via your backend server, such as processing checkout or card issuance flows.
Expand Down Expand Up @@ -1147,7 +1147,7 @@ Invoke connection response: { data: { status: 'success', transaction_id: 'txn_ab
**pathParams, queryParams, header, body** are the JSON objects represented as dictionaries that will be sent through the connection integration url.

> [!TIP]
> See the full example in the samples directory: [scoped-token-generation-example.ts](samples/vault-api/invoke-connection.ts)
> See the full example in the samples directory: [invoke-connection.ts](samples/vault-api/invoke-connection.ts)
> See [docs.skyflow.com](https://docs.skyflow.com) for more details on integrations with Connections, Functions, and Pipelines.

## Authentication & authorization
Expand Down Expand Up @@ -1204,7 +1204,7 @@ Generate and manage bearer tokens to authenticate API calls. This section covers

#### Generate a bearer token

Generate service account tokens using the [Service Account](https://github.com/skyflowapi/skyflow-node/tree/v2/src/service-account) Node package with a service account credentials file provided when a service account is created. Tokens generated by this module are valid for 60 minutes and can be used to make API calls to the [Data](https://docs.skyflow.com/record/) and [Management](https://docs.skyflow.com/management/) APIs, depending on the permissions assigned to the service account.
Generate service account tokens using the [Service Account](https://github.com/skyflowapi/skyflow-node/tree/main/common/src/service-account) Node package with a service account credentials file provided when a service account is created. Tokens generated by this module are valid for 60 minutes and can be used to make API calls to the [Data](https://docs.skyflow.com/record/) and [Management](https://docs.skyflow.com/management/) APIs, depending on the permissions assigned to the service account.

##### `generateBearerToken(filepath)`

Expand Down Expand Up @@ -1266,7 +1266,7 @@ if (expired) {
```

> [!TIP]
> See the full example in the samples directory: [token-generation-example.ts](http://github.com/skyflowapi/skyflow-node/blob/v2/samples/service-account/token-generation-example.ts)
> See the full example in the samples directory: [token-generation-example.ts](samples/service-account/token-generation-example.ts)

#### Generate bearer tokens scoped to certain roles

Expand Down Expand Up @@ -1525,7 +1525,7 @@ Most first-run problems come from configuration mismatches. Every error thrown b

| Symptom | Likely cause | Fix |
|---|---|---|
| `npm install skyflow-node` fails | Unsupported Node version | Requires Node v12.22.12 or above. |
| `npm install skyflow-node` fails | Unsupported Node version | Requires Node.js v18 or above. |
| Connection/DNS failures, or 404 on every call | Wrong `clusterId` | `clusterId` is the first segment of your vault URL: `https://{clusterId}.vault.skyflowapis.com`. |
| Requests hit the wrong host / unexpected auth failures | Wrong `env` | Match `env` to where your vault runs (`Env.PROD`, `Env.SANDBOX`, `Env.DEV`, `Env.STAGE`). |
| `401 Unauthorized` | Invalid or expired credentials | Verify your API key or service-account credentials. Regenerate if needed. |
Expand Down
2 changes: 1 addition & 1 deletion skyvault/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Explore working examples that demonstrate common SDK operations. Start with basi
## Prerequisites

- A Skyflow account. If you don't have one, register for one on the [Try Skyflow](https://skyflow.com/try-skyflow) page.
- [Node 7.6.0](https://nodejs.org/en/) and above.
- [Node.js](https://nodejs.org/en/) v18 and above. File-upload and de-identify-file samples require Node.js v20 and above.
Comment thread
promptless[bot] marked this conversation as resolved.
Resolved

## Prepare

Expand Down
Loading