Session Management

Signing with Capsule requires an Active Session -- this is 120 mins by default.

Before signing a transaction, you'll need to add login to handle this like the below (and the user will be re-prompted to sign with their passkey)

const isLoggedIn = await capsule.isFullyLoggedIn()
if (!isLoggedIn) {
  await capsule.refreshSession()
}
capsuleEthersSigner.signTransaction()

Extending Sessions

Many SDK calls indicating the user is still active will prolong the session. In cases where the preference is to extend the session programmatically, the following method can be used:

// keepAliveIsSuccessful is true when keep alive call was successful, false otherwise
const keepAliveIsSuccessful = await capsule.keepSessionAlive();

Last updated