ConnectionTokenProvider

Before integrating the SDK, you should create an endpoint on your backend server that creates a new connection token via the Stripe Terminal API. The connection token is used by the SDK to connect to a reader.

An overview of the lifecycle of a connection token:

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

  • Do not cache or hardcode the connection token.

  • The SDK uses the connection to connect to a reader.

  • Subsequent calls to connect require a new connection token. If you disconnect from a reader, and then call connect again, the SDK will need a new connection token from your backend server. The SDK manages the connection token’s lifecycle and will always request a new connection token automatically when necessary.

We suggest making your application's API client conform to this protocol.

For more information, see the official Stripe docs: Connection Token

Use of this SDK is subject to the Stripe Terminal Terms: https://stripe.com/terminal/legal

Functions

Link copied to clipboard

Fetches a connection token from your backend server.