StartaleAccountClient you already use.
Source:
StartaleGroup/scs-aa-sdk. The flow below mirrors the production integration in the Startale super-app.How it fits together
Two artefacts come out of the granting step:- A permission id that identifies the policy onchain.
- A session key keypair. The public key is committed to the policy; the private key is used by your backend or browser to sign UserOperations within scope.
1. Check whether the module is installed
getSmartSessionsValidator builds the validator descriptor. The module is keyed by its onchain address, so you can call isModuleInstalled on the account client to check status before installing.
2. Install the module (one-time per account)
If the module is not installed, install it once. Installation is itself a UserOperation, so it goes through your bundler and (optionally) your paymaster.3. Define the permission scope
A session scope is a list ofCreateSessionDataParams. Each entry binds the session key to a contract and a function selector, with optional onchain policies.
4. Grant the permission
Granting the permission is also a UserOperation, signed once by the account owner. UsesmartSessionCreateActions to extend the account client with the granting action, then call grantPermission.
5. Execute UserOperations under the session
Once granted, build a separateStartaleAccountClient whose signer is the session key. UserOperations from this client are validated by the Smart Sessions module instead of the account’s default validator.
Operational guidance
Next steps
Social recovery
Combine sessions with a guardian-based recovery module.
Sponsored paymaster
Sponsor every session UserOperation through the SCS paymaster.
Parallel transactions
Run independent session UserOperations concurrently.
Smart account setup
Refresh the underlying account and client setup.