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

# QR scanner

> Open the shell's full-screen QR and barcode reader.

The shell opens its own full-screen reader. Your page never touches the camera stream; it just receives the decoded text.

```tsx theme={null}
import { useQRScanner } from '@cskn/sdk';

function CheckIn() {
  const { scan, scanning } = useQRScanner();

  const onClick = async () => {
    const result = await scan({ title: 'Scan a ticket' });
    if (result.cancelled || result.error) return;
    checkIn(result.data!);
  };

  return <button onClick={onClick}>{scanning ? 'Scanner open…' : 'Scan QR'}</button>;
}
```

## Options

<ParamField path="formats" type="BarcodeFormat[]" default="['qr']">
  Symbologies to accept: `qr`, `aztec`, `datamatrix`, `pdf417`, `ean13`, `ean8`, `upc_a`, `upc_e`, `code39`, `code93`, `code128`, `codabar`, `itf14`. `qr` works everywhere; the others depend on the device's detector.
</ParamField>

<ParamField path="title" type="string">
  Reader title.
</ParamField>

<ParamField path="hint" type="string">
  Text under the frame.
</ParamField>

<ParamField path="allowGallery" type="boolean" default="true">
  Let the user decode a code from a saved image. On iOS this decodes QR only.
</ParamField>

## Result

<ResponseField name="data" type="string">The decoded text. Present only on a successful read.</ResponseField>
<ResponseField name="format" type="BarcodeFormat">The symbology that was read.</ResponseField>
<ResponseField name="cancelled" type="boolean">The user closed the reader.</ResponseField>

<ResponseField name="error" type="'permission_denied' | 'busy' | 'not_available'">
  No camera permission, another scan is already open, or this surface has no reader.
</ResponseField>

Only one reader can be open at a time. In a browser, `scan` resolves immediately with `not_available`. Without the hook, use `scanQRCode(options)`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.