> ## Documentation Index
> Fetch the complete documentation index at: https://intunedhq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getAuthSessionParameters

```typescript theme={null}
import { getAuthSessionParameters } from '@intuned/runtime';

async function getAuthSessionParameters(): Promise<any>
```

Returns the parameters used to create the current AuthSession. Use this to access credentials or configuration values that were provided when the AuthSession was created.

This function only works with Credentials-based AuthSessions. It allows your automation to access the original parameters (like usernames, API keys, or other identifiers) without hardcoding them.

**Returns**

Returns `Promise<any>` — The parameters object used to create the AuthSession.

**Throws**

* `Error` — Thrown if the project doesn't use AuthSessions.
* `Error` — Thrown if the AuthSession is Recorder-based (not Credentials-based).
* `Error` — Thrown if the AuthSession is Runtime-based.

## Example: branching on a login flow

When a single site exposes more than one login flow (for example, separate provider and patient logins on the same portal), include a discriminator parameter when the AuthSession is created and read it back inside `check` to validate the correct post-login state.

```typescript auth-sessions/create.ts theme={null}
import { BrowserContext, Page } from "playwright";
import { goToUrl } from "@intuned/browser";

export interface CreateParams {
  loginType: "provider" | "patient";
  username: string;
  password: string;
}

export default async function create(
  params: CreateParams,
  page: Page,
  context: BrowserContext
) {
  await goToUrl({ page, url: "https://portal.example.com/login" });
  await page.getByPlaceholder("Username").fill(params.username);
  await page.getByPlaceholder("Password").fill(params.password);
  await page.getByRole("button", { name: "Sign in" }).click();

  const dashboardPath =
    params.loginType === "provider" ? "/provider/dashboard" : "/patient/home";
  await page.waitForURL(`https://portal.example.com${dashboardPath}`);
}
```

```typescript auth-sessions/check.ts theme={null}
import { BrowserContext, Page } from "playwright";
import { goToUrl } from "@intuned/browser";
import { getAuthSessionParameters } from "@intuned/runtime";

export default async function check(
  page: Page,
  context: BrowserContext
): Promise<boolean> {
  const params = (await getAuthSessionParameters()) as {
    loginType: "provider" | "patient";
  };

  const path =
    params.loginType === "provider" ? "/provider/dashboard" : "/patient/home";
  await goToUrl({ page, url: `https://portal.example.com${path}` });

  return !page.url().includes("/login");
}
```

When the AuthSession is created with `parameters.loginType: "provider"`, both `create` and `check` follow the provider flow; passing `"patient"` switches both to the patient flow.

## Related

* [AuthSessions](/main/02-features/auth-sessions) — Learn about authentication session management.
* [Multiple login flows on the same site](/main/02-features/auth-sessions#usage-patterns) — Usage pattern this example supports.
