About Connect Sessions

Prerequisites

In order to use Connect Sessions, you will need:

What Connect Sessions are

Connect Sessions allow developers to streamline the user experience by launching Connect in the state it needs to be in for the user to perform a certain action, eliminating unnecessary steps. This is achieved by specifying an intent when creating the Connect Session.

An intent could be purchasing a subscription or updating a users' payment method (for a full list of possible intents, please refer to the API documentation or the dedicated section in this guide).

You can make using Connect smoother for users by automatically filling in data you already have when setting up the Connect Session. This way, users don't have to input information you already have again. For instance, if you're aware of the user's chosen plan and their details, add this information when you create the Connect Session. As a result, users can go straight to the checkout without having to log in again, type in their details a second time, or select a plan.

How Connect Sessions are created

sequenceDiagram participant C as Your Application participant GA as Gigs API participant GC as Gigs Connect C->>GA: Create Connect Session activate GA GA->>C: Return Connect session deactivate GA C->>GC: Redirect user to url from Connect session activate GC GC->>GC: User performs intended actions rect rgb(230, 237, 232) note left of GC: Not yet available GC->>C: User returns to your application deactivate GC end

The flow is initiated by your application making a POST request to /connectSessions. The Gigs backend creates the Connect Session and returns it to you. Within the Connect Session, you will find a url field that you can use to redirect the user from your application to Connect. Connect verifies the Connect Session and redirects the user to the desired location (i.e. the checkout with a plan and SIM already selected). In the case of errors, Connect will redirect the user back to a callbackUrl you defined.

For more information on creating Connect Sessions, please refer to the dedicated section of this guide.

Redirecting the user back to your application

If you have defined a callbackUrl in the Connect Session, then the user will be redirected to it whenever they have performed the intended action within Connect. Please refer to the dedicated section of this guide for further information.

Where to go from here