Session Keys (SDK)
Learn how to use session keys using the Wallet Client SDK
1. Install Prerequisites
You’re going to need the @account-kit/wallet-client
and @account-kit/infra
. We’ll also be using LocalAccountSigner
from @aa-sdk/core
as the signer for demonstration purposes.
2. Create A Smart Wallet Client
Create a client for a given signer (e.g. a LocalAccountSigner
imported from @aa-sdk/core
or an Alchemy Signer).
3. Create the session key
Using EIP-7702?
If you are using an EIP-7702 account, the account must be delegated onchain before creating the session. If the account has already sent calls, it will already be delegated. If it hasn’t sent any calls before creating the session key, you can delegate it by sending an empty call as the owner:
Now you can continue to create the session key as described below.