When using pre-generated wallets, session management works differently as these wallets don’t require traditional authentication.

How Sessions Work with Pre-Generated Wallets

For pre-generated wallets, the session is considered always active as long as the UserShare is loaded in the Para client instance. Traditional session expiration doesn’t apply in this scenario.

const para = new Para(env, apiKey);

// Set a pre-generated wallet
await para.setUserShare(userShare);

// Session checks will return true as long as userShare is loaded
const isActive = await para.isSessionActive(); // Always true for pre-gen wallets

Session Management Methods for Pre-Generated Wallets

When a UserShare is loaded via setUserShare(), the session remains active indefinitely. Methods like isSessionActive() will return true as long as the UserShare remains loaded in the Para client instance.

Learn More

Pre-Generated Wallets

Best Practices

  • UserShare Management: Ensure the UserShare remains loaded in the Para instance for continuous session availability
  • Security: Store UserShares securely and never expose them in client-side code
  • Session Verification: Remember that isSessionActive() will always return true for loaded pre-generated wallets