https://github.com/sentclose/sentc-flutter-secure-storage
An alternative sentc storage implementation with flutter secure storage
https://github.com/sentclose/sentc-flutter-secure-storage
Last synced: over 1 year ago
JSON representation
An alternative sentc storage implementation with flutter secure storage
- Host: GitHub
- URL: https://github.com/sentclose/sentc-flutter-secure-storage
- Owner: sentclose
- License: agpl-3.0
- Created: 2023-06-18T15:27:20.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-18T20:22:06.000Z (about 3 years ago)
- Last Synced: 2025-02-01T09:44:58.512Z (over 1 year ago)
- Language: C++
- Size: 292 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# sentc_flutter_secure_storage
This plugin uses the flutter secure storage to securely store the keys on the native device.
To change the storage, just set the storage option in the init function.
```dart
import 'package:sentc/sentc.dart';
import 'package:sentc_flutter_secure_storage/sentc_flutter_secure_storage.dart';
void main() async {
await Sentc.init(
appToken: "5zMb6zs3dEM62n+FxjBilFPp+j9e7YUFA+7pi6Hi",
storage: SecureStorage(), //init with the other storage
);
}
```
To install and configure the storage please follow the [flutter_secure_storage instructions](https://github.com/mogol/flutter_secure_storage).
You can also pre configure the storage and set it then to sentc. This is useful if you need to set other options for the storage.
```dart
import 'package:sentc/sentc.dart';
import 'package:sentc_flutter_secure_storage/sentc_flutter_secure_storage.dart';
void main() async {
//set other android option to use android encryptedSharedPreferences (only for Android >= V5)
AndroidOptions getAndroidOptions() => const AndroidOptions(
encryptedSharedPreferences: true,
);
final storage = FlutterSecureStorage(aOptions: getAndroidOptions());
await Sentc.init(
appToken: "5zMb6zs3dEM62n+FxjBilFPp+j9e7YUFA+7pi6Hi",
storage: SecureStorage(storage), //set the storage with options
);
}
```