Configure Environment

Control how your wallet interacts with blockchains.


Environment configuration allows variables to be used throughout a FunWallet SDK flow without having to redefine them. Each environment variable has a default value. The following environment variables can be specified:

Environment VariableDefault Value
API KeyZrhepzWGxm74D0sqstuhT6dGrJxhoy8SZIToX6I3
Target BlockchainGoerli
Gas Payment ModeBase Gas Token
Developer FeeNo fee

The environment variable types are defined in the EnvironmentManager interface. Read the API Reference.

import { configureEnvironment } from "@funkit/core";
const apiKey = "ZrhepzWGxm74D0sqstuhT6dGrJxhoy8SZIToX6I3"
await configureEnvironment({
chain: "goerli",
apiKey
})

The values in the environment config can be overridden on a transaction-by-transaction basis. Overridden environment variables are specified in the options parameter, found at the end of every FunWallet method's parameter list.

Below are the ways the FunWallet SDK allows you to configure your environment: