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

# Responses

> Handle MiniKit command results with `{ executedWith, data }` and standard error handling.

Modern MiniKit commands are async methods on `MiniKit`. They resolve to a result object shaped like `{ executedWith, data }` and throw if the command fails.

## Async Command Results

Use `executedWith` to understand whether the command ran through World App, Wagmi, or a custom fallback.

```tsx theme={null}
import { MiniKit } from "@worldcoin/minikit-js";
import type {
  CommandResultByVia,
  MiniKitWalletAuthOptions,
  WalletAuthResult,
} from "@worldcoin/minikit-js/commands";

async function signInWithWallet() {
  const input = {
    nonce: "random-nonce-123",
  } satisfies MiniKitWalletAuthOptions;

  try {
    const result: CommandResultByVia<WalletAuthResult> =
      await MiniKit.walletAuth(input);

    console.log(result.executedWith);
    // "minikit" | "wagmi" | "fallback"

    console.log(result.data.address);
    console.log(result.data.signature);
  } catch (error) {
    console.error("Command failed", error);
  }
}
```

## What To Expect

* `executedWith` tells you which runtime handled the command
* `data` contains the success payload for that command
* command-specific failures are thrown, so use `try/catch`
* some commands still require backend verification even after a successful response, such as `walletAuth` and `pay`

## Event Subscriptions

For new 2.x command integrations, prefer `await MiniKit.<command>()`.
