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

# Placing your check

> Open the session in the browser with vycheck() and hand the token to your server.

```bash theme={null}
npm install @verifyyou-sdk/client
```

The SDK opens the session your server minted and hands back a token. No key, no `init()`. It is not a router: put `vycheck()` on the action only humans should do, and send the token with that action.

<Tabs>
  <Tab title="Redirect">
    Zero UI to build. We host the whole flow and send them back to `redirect_url` with `?vyt=<token>&vyc=<0|1>`. `vycheck` navigates away, so it never resolves; on the way back, `vyget()` reads the result off the URL.

    ```js 1. where they leave theme={null}
    import { vycheck } from "@verifyyou-sdk/client";

    // `session` is the id provided by your server
    try {
      await vycheck({ session: sessionId });
    } catch (err) {
      // Only reachable BEFORE the browser navigates away: the session expired
      // or was already used, or we couldn't be reached. Mint a new session.
      console.error("verifyyou:", err.message);
      throw err;
    }

    // Nothing below here runs. The page is already gone.
    ```

    ```js 2. where they come back theme={null}
    import { vyget } from "@verifyyou-sdk/client";

    // run on every page load to check for the token (will not error if no token is found)
    const { token } = vyget();

    if (token) {
      // check with your server if the person is verified
      await fetch("/api/verify", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ token }),
      });
    }
    ```
  </Tab>

  <Tab title="Drawer">
    Slides over your page: bottom sheet on mobile, side panel on desktop. No redirect. `vycheck` resolves in place with the result.

    ```js theme={null}
    import { vycheck } from "@verifyyou-sdk/client";

    // `session` is the id from step 1. It runs THAT session, the one already
    // carrying your external_id and redirect_url, so there is no key and no
    // init() on this path.
    try {
      const { token } = await vycheck({ session: sessionId, mode: "iframe" });
      // No token = they closed it without finishing. Not an error; let them retry.
      if (token) {
        // Hand it to your own endpoint; the confirm runs there, with your secret key.
        await fetch("/api/verify", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ token }),
        });
      }
    } catch (err) {
      // Session expired or already used, or we couldn't be reached.
      // Mint a fresh session and let them try again.
      console.error("verifyyou:", err.message);
    }
    ```
  </Tab>

  <Tab title="Inline">
    Mounts inside your own element, like an embedded video. `vycheck` resolves in place with the result.

    ```js theme={null}
    import { vycheck } from "@verifyyou-sdk/client";

    try {
      const { token } = await vycheck({
        session: sessionId,
        mode: "iframe",
        display: "inline",
        container: "#verify-here", // your element; size it with CSS
      });
      if (token) {
        await fetch("/api/verify", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ token }),
        });
      }
    } catch (err) {
      console.error("verifyyou:", err.message);
    }
    ```

    ```html theme={null}
    <!-- the flow fills this element, like an embedded video -->
    <div id="verify-here" style="height: 640px"></div>
    ```
  </Tab>
</Tabs>

Options and modes: [`vycheck()`](/v3/dev/spec/browser-sdk/vycheck). What a rejection looks like: [Errors](/v3/dev/spec/browser-sdk/errors).
