Skip to content

An alternative sentc storage implementation with flutter secure storage

License

Notifications You must be signed in to change notification settings

sentclose/sentc-flutter-secure-storage

Repository files navigation

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.

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.

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.

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
  );
}

About

An alternative sentc storage implementation with flutter secure storage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published