Prerequisites
- Completed the Quickstart
- A Rhinestone dashboard API key
Steps
1
Install smart sessions on the account
Enable the Smart Sessions module when creating the account:If the account is already deployed, you can install the module in a separate transaction:
2
Generate a session key
Create an ephemeral key pair that your app will use to sign on the user’s behalf. In production, store this key securely. Use
localStorage for client-side sessions, or a KMS/secrets manager for server-side automation.3
Define the session
Specify what the session key is allowed to do. Here we restrict it to USDC transfers only, with a 100 USDC spending limit:
By default, a session with no permissions allows any transaction. Always restrict sessions to the minimum necessary permissions.
4
Enable the session
The account owner signs to approve the session. This is the one-time approval the user sees:
5
Execute transactions with the session key
Now your app can execute USDC transfers without prompting the user. The session key signs instead of the owner:The user’s MetaMask (or other wallet) is never involved. Your app signed with the session key, within the spending limit the user approved.
What you built
- A smart account with Smart Sessions installed
- A scoped session key (USDC transfers only, 100 USDC limit)
- One-time user approval flow
- App-signed transactions with no user prompts
Security checklist
Before shipping session keys to production:- Store the session key securely. Use
localStoragefor browser-side sessions, a KMS or secrets manager for server-side automation. - Apply the principle of least privilege. Only request the actions your app actually needs.
- Set a timeframe policy. Add an expiry so sessions don’t live forever.
- Set spending limits. Cap ERC20 transfers to a sensible amount.
Next steps
Smart Sessions reference
Full details on owners, actions, policies, and multi-session signatures.
Policies
Explore all available policies: timeframe, usage limit, call restrictions.
Sponsor fees
Combine session keys with fee sponsorship for a fully frictionless UX.