Skip to main content

Initializing Core Kit SFA Flutter SDK

After Installation, the next step to use Web3Auth SFA Flutter is to Initialize the SDK and is achieved by init() function. This step requires passing various parameters that align with your project preferences. It's important to note that the initialization process is critical to the successful use of Web3Auth SFA Flutter.

Arguments

Construct and configure the init function with the params as follows

Web3AuthNetwork

ParameterDescription
networkThe Web3auth network to be used by the SDK. Supported values are TorusNetwork.mainnet, TorusNetwork.testnet, TorusNetwork.cyan, TorusNetwork.aqua

Using the init() function

Initialize the Web3AuthFlutter plugin at the very beginning such as in the overriden initState function

Usage
import 'package:single_factor_auth_flutter/single_factor_auth_flutter.dart';
final _singleFactorAuthFlutterPlugin = SingleFactAuthFlutter();

Future<void> init() async {
await _singleFactorAuthFlutterPlugin.init(
Web3AuthNetwork(network: torusNetwork),
);
}