Catalog & commerce

The launch flow

What happens between a click in App Center and your application's first authenticated request.

Launching is a redirect, not an API call. App Center does not mint a token for your application and does not push data into it — the browser carries the context.

The sequence

  1. 1

    A person clicks Launch

    App Center checks that the account holds an active subscription to your application and that the person is a member with access.

  2. 2

    The browser is redirected

    To your webUrl, plus the launchParams you declared for that membership in your assigned-apps answer — { "au": "…", "uu": "…" } becomes ?au=…&uu=…. An application that declares none launches with a bare URL.

  3. 3

    Your application starts a session

    If there is no session, run the OIDC flow. The provider session usually still exists, so the person is returned without typing anything.

  4. 4

    You validate the context

    Confirm the signed-in person is a member of au and holds the privilege the screen needs. A hint in a URL is not proof.

  5. 5

    You read what you need

    GET /app/me, then GET /app/users/:userUuid and GET /app/subscriptions/:accountUuid from your backend, with your service token.

Handling the parameters

launch.ts
const url = new URL(request.url);
const accountHint = url.searchParams.get("au");
const userHint = url.searchParams.get("uu");

// 1. Strip them from the visible URL so a refresh or a share does not replay them.
// 2. Resolve the session.
// 3. Keep the hint only if it matches a membership the session actually has.
const account = memberships.find((m) => m.accountUuid === accountHint) ?? memberships[0];

return NextResponse.redirect(new URL("/dashboard", request.url));

Never provision from a launch link

A crafted ?au= must not create a membership, a business record or a subscription. If the account is not one the session belongs to, ignore the hint and fall back to the person's own default.

The same membership can end the other way: from My Apps, a person who was added to an account can give up their own membership. Access is removed and the trail is not — the sales, orders and audit rows they left behind stay where they are, which is why nothing here needs to provision from a launch link in the first place.

Testing it

  • Launch with a person who belongs to two accounts and confirm the right one opens.
  • Load your launch URL directly with no session and confirm you land on sign-in and come back.
  • Load it with a foreign au and confirm nothing leaks.
  • Delete the session mid-flow and confirm a single re-auth, not a loop.

Something here out of date or unclear?

The platform team answers integration questions directly.

support@versified.com.gh
32 pages in this documentation