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

# showDeviceLinkQR()

> Reference for the Embedded API showDeviceLinkQR() method.

Use `showDeviceLinkQR()` to display a QR pairing flow for the Corti mobile companion app. The method opens the embedded QR approval screen, waits for the pairing request to settle, and returns the final status.

<Info>
  Applies to Web Component, Window API, and PostMessage. Examples on this page
  use the Web Component API shape.
</Info>

<Check>
  Enable the companion app surface with
  [`configureApp()`](/assistant/api/configure-app) before offering mobile
  pairing controls in your host application.
</Check>

## Usage

```ts title="TypeScript" theme={null}
// Replace these with your values
const ACCESS_TOKEN = "<your-access-token>";
const REFRESH_TOKEN = "<your-refresh-token>";

await api.configureApp({
  companionApp: {
    enabled: true,
  },
});

const result = await api.showDeviceLinkQR({
  access_token: ACCESS_TOKEN,
  refresh_token: REFRESH_TOKEN,
  token_type: "Bearer",
});

if (result.status === "approved") {
  // The mobile companion app was paired successfully.
}
```

## Prerequisites

* User must be authenticated in the embedded Assistant.
* `companionApp.enabled` should be set to `true` in `configureApp()`.
* The payload must include a valid access token and refresh token for the same user session.

## Input validation

* `access_token`: Must be a valid OAuth access token.
* `refresh_token`: Must be present. The mobile companion app uses it to complete pairing after approval.
* `token_type`: Must match the OAuth token response, usually `"Bearer"`.

## Returns

```typescript theme={null}
type ShowDeviceLinkQRResponse = {
  status: "approved" | "denied" | "expired" | "dismissed";
};
```

* `approved`: The user approved the mobile device pairing request.
* `denied`: The user denied the mobile device pairing request.
* `expired`: The QR code or approval window expired before pairing completed.
* `dismissed`: A new QR request replaced the previous one, the embedded route was dismissed, or the pairing flow could not complete.

## Possible errors

* `UNAUTHORIZED`: User not authenticated.
* `INVALID_PAYLOAD`: Token payload is missing required values.
* `INTERNAL_ERROR`: Failed to create or display the pairing request.

## Related reference

* [API Reference Overview](/assistant/api-reference)
* [configureApp()](/assistant/api/configure-app)
* [Web Component API](/assistant/web-component-api)
