clearCachedCredentials

Clears the current connection token, saved reader sessions, and any other cached credentials. You can use this method to switch accounts in your app, e.g. to switch between live and test Stripe API keys on your backend.

In order to switch accounts in your app:

An overview of the lifecycle of a connection token under the hood:

  • When a Terminal is initialized, the SDK attempts to proactively request a connection token from your backend server.

  • When connectReader is called, the SDK uses the connection token and reader information to create a reader session.

  • Subsequent calls to connectReader require a new connection token. If you disconnect from a reader, and then call connectReader again, the SDK will fetch another connection token.