Skip to main content

Initializing SFA iOS SDK

After Installation, the next step to use Web3Auth is to Initialize the SDK. Please note that these are the most critical steps where you need to pass on different parameters according to the preference of your project.

import SingleFactorAuth

let singleFactorAuthArgs = SingleFactorAuthArgs(
web3AuthClientId: "<Your Web3Auth Client Id>",
network: Web3AuthNetwork.SAPPHIRE_MAINNET
)
let singleFactoreAuth = SingleFactorAuth(singleFactorAuthArgs: singleFactorAuthArgs)

SingleFactorAuthArgs

The singleFactoreAuth constructor takes an object called SingleFactorAuthArgs as input. The below are the aviliable fields of the SingleFactorAuthArgs object.

ParameterDescription
web3AuthClientIdYour Web3Auth Client Id from Web3Auth Dashboard.
networkThe Web3auth network to be used by the SDK. Supported values are Web3AuthNetwork.SAPPHIRE_MAINNET, Web3AuthNetwork.SAPPHIRE_DEVNET, Web3AuthNetwork.MAINNET, Web3AuthNetwork.TESTNET, Web3AuthNetwork.CYAN, Web3AuthNetwork.AQUA
networkUrlCustom network url for Web3Auth network. Used for internal testing purposes.