Affinidi TDK - Vault Storage
The Affinidi TDK Vault Storage package provides the storage layer of the Affinidi TDK Vault integrated into your Dart applications. This package allows you to manage folders and files related to your vault profile in the secure cloud storage.
This package is still in EXPERIMENTAL status.
Requirements
- Dart SDK version ^3.6.0
Installation
Run:
dart pub add affinidi_tdk_vault_storages
or manually add the package to your pubspec.yaml
file:
dependencies:
affinidi_tdk_vault_storages: ^<version_number>
and then run the command below to install the package:
dart pub get
For more information, visit the pub.dev install page of the Affinidi TDK - Vault Storage package.
Usage
After successfully installing the package, import it into your code.
import 'dart:typed_data';
import 'package:affinidi_tdk_vault_data_manager_client/affinidi_tdk_vault_data_manager_client.dart';
import 'package:affinidi_tdk_vault_storages/affinidi_tdk_vault_storages.dart';
import 'package:storage/storage.dart';
import 'package:ssi/ssi.dart';
void main() async {
// Initialize the VaultDataManagerService
final vaultDataManagerService = await VaultDataManagerService.create(didSigner: didSigner);
// once you have the service you need to:
// 1. create your first profile using [profiles/create_profile.dart] example
// 2. create StorageService with [profileId] created on the first step
final storageService = StorageService(
vaultDataManagerService: vaultDataManagerService,
profileId: 'your_profile_id',
);
// once you have storage service you can create folder under you profile using:
try {
print('Start creating folder under profile...');
await storageService.createFolder(folderName: 'your_folder_name');
print('Finish creating folder under profile');
} catch (e) {
print('Failed to create folder under profile: $e');
}
}
For more sample usage, go to the example folder.
Support & feedback
If you face any issues or have suggestions, please don't hesitate to contact us using this link.
Reporting technical issues
If you have a technical issue with the package's codebase, you can also create an issue directly in GitHub.
-
Ensure the bug was not already reported by searching on GitHub under Issues.
-
If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behaviour that is not occurring.
Contributing
Want to contribute?
Head over to our CONTRIBUTING guidelines.
Libraries
- affinidi_tdk_vault_storages
- Support for doing something awesome.