You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
skyflowCredentials.setApiKey("<YOUR_API_KEY>"); // Replace <API_KEY> with your actual API key
342
+
343
+
// Option 2: Environment Variables (Recommended)
344
+
// Set SKYFLOW_CREDENTIALS in your environment
345
+
346
+
// Option 3: Credentials File
347
+
skyflowCredentials.setPath("<YOUR_CREDENTIALS_FILE_PATH>"); // Replace with the path to credentials file
348
+
349
+
// Option 4: Stringified JSON
350
+
skyflowCredentials.setCredentialsString("<YOUR_CREDENTIALS_STRING>"); // Replace with the credentials string
351
+
352
+
// Option 5: Bearer Token
353
+
skyflowCredentials.setToken("<BEARER_TOKEN>"); // Replace <BEARER_TOKEN> with your actual authentication token.
354
+
```
355
+
356
+
**Notes:**
357
+
- Use only ONE authentication method.
358
+
- API Key or Environment Variables are recommended for production use.
359
+
- Secure storage of credentials is essential.
360
+
- For overriding behavior and priority order of credentials, refer to the README.
361
+
362
+
---
363
+
364
+
### 2. Client Initialization
365
+
In V2, we have introduced a Builder design pattern for client initialization and added support for multi-vault. This allows you to configure multiple vaults during client initialization.
366
+
367
+
In V2, the log level is tied to each individual client instance.
368
+
369
+
During client initialization, you can pass the following parameters:
370
+
-`vaultId` and `clusterId`: These values are derived from the vault ID & vault URL.
371
+
-`env`: Specify the environment (e.g., SANDBOX or PROD).
372
+
-`credentials`: The necessary authentication credentials.
373
+
374
+
### V1 (Old)
375
+
```java
376
+
// DemoTokenProvider class is an implementation of the TokenProvider interface
credentials.setPath("<YOUR_CREDENTIALS_FILE_PATH_1>"); // Replace with the path to the credentials file
386
+
387
+
// Configure the first vault (Blitz)
388
+
VaultConfig config =newVaultConfig();
389
+
config.setVaultId("<YOUR_VAULT>"); // Replace with the ID of the first vault
390
+
config.setClusterId("<YOUR_CLUSTER>"); // Replace with the cluster ID of the first vault
391
+
config.setEnv(Env.DEV); // Set the environment (e.g., DEV, STAGE, PROD)
392
+
config.setCredentials(credentials); // Associate the credentials with the vault
393
+
394
+
// Set up credentials for the Skyflow client
395
+
Credentials skyflowCredentials =newCredentials();
396
+
skyflowCredentials.setPath("<YOUR_CREDENTIALS_FILE_PATH_2>"); // Replace with the path to another credentials file
397
+
398
+
// Create a Skyflow client and add vault configurations
399
+
Skyflow skyflowClient =Skyflow.builder()
400
+
.setLogLevel(LogLevel.DEBUG) // Enable debugging for detailed logs
401
+
.addVaultConfig(config) // Add the first vault configuration
402
+
.addSkyflowCredentials(skyflowCredentials) // Add general Skyflow credentials
403
+
.build();
404
+
```
405
+
406
+
**Key Changes:**
407
+
-`vaultUrl` replaced with `clusterId`.
408
+
- Added environment specification (`env`).
409
+
- Instance-specific log levels.
410
+
411
+
---
412
+
413
+
### 3. Request & Response Structure
414
+
In V2, we have removed the use of JSON objects from a third-party package. Instead, we have transitioned to accepting native ArrayList and HashMap data structures and adopted the Builder pattern for request creation. This request need
415
+
-`table`: The name of the table.
416
+
-`values`: An array of objects containing the data to be inserted.
417
+
The response will be of type InsertResponse class, which contains insertedFields and errors.
0 commit comments