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

# Verify a Credential in Your App

> Prompt users to present a verifiable credential inside your app and gate features, content, or services based on the zero-knowledge verification result.

This recipe shows how to verify a user's credential inside your application using the AIR Kit SDK. After verification, you can gate access to features, content, or services based on the result.

## What you'll build

1. A verification program configured for your app.
2. SDK code that prompts the user to present a credential.
3. Application logic that reacts to the verification result.

## Prerequisites

* AIR Kit SDK installed and initialized. See [Installation](/airkit/usage/installation) and [Initialization](/airkit/usage/initialization).
* A Verifier DID from the [Developer Dashboard](https://developers.sandbox.air3.com/dashboard).
* At least one credential issued to a test user (see [Issue Credentials Quickstart](/airkit/quickstart/issue-credentials)).

## Step 1: Create a verification program

1. Go to the Developer Dashboard.
2. Navigate to **Verifier > Programs**.
3. Create a new verification program, selecting the credential schema you want to verify against.
4. Note the **Verification Program ID**.

## Step 2: Authenticate the user

The user must have an active session before verification. Use the AIR Kit login flow:

```ts theme={null}
const airService = new AirService();
await airService.init({ partnerId: "your-partner-id" });
const loginResult = await airService.login();
```

## Step 3: Request credential verification

Call `verifyCredentials` with your Verifier DID and the verification program ID:

<Tabs>
  <Tab title="Web">
    ```ts theme={null}
    const verificationResult = await airService.verifyCredentials({
      verifierDid: "did:air:id:test:YOUR_VERIFIER_DID",
      verificationId: "YOUR_VERIFICATION_PROGRAM_ID",
    });

    if (verificationResult.verified) {
      console.log("Credential verified:", verificationResult);
      grantAccess();
    } else {
      console.log("Verification failed or was declined");
      denyAccess();
    }
    ```
  </Tab>

  <Tab title="Flutter">
    ```dart theme={null}
    final result = await airService.verifyCredentials(
      verifierDid: "did:air:id:test:YOUR_VERIFIER_DID",
      verificationId: "YOUR_VERIFICATION_PROGRAM_ID",
    );

    if (result.verified) {
      grantAccess();
    } else {
      denyAccess();
    }
    ```
  </Tab>
</Tabs>

The SDK opens a built-in UI asking the user to select and present a matching credential. Zero-knowledge proofs are used — the verifier confirms the claim without seeing the raw data.

## Step 4: Gate features based on the result

```ts theme={null}
function grantAccess() {
  // User has a valid credential — show premium content, unlock tier benefits, etc.
}

function denyAccess() {
  // No valid credential — redirect to onboarding or show a restricted view
}
```

## Auth token for server-side verification

If you need to verify from your backend instead, generate a Partner JWT with `scope: "verify"`:

```js theme={null}
const payload = {
  partnerId: "your-partner-id",
  scope: "verify",
  exp: Math.floor(Date.now() / 1000) + 5 * 60,
};
```

See [Partner Authentication](/airkit/usage/partner-authentication) for full JWT setup.

## Next steps

* [Credential Verification reference](/airkit/usage/credential/verify) for the full API
* [Schema Design](/airkit/usage/credential/schema-overview) to understand what fields are verifiable
* [Quickstart: Credential Verification](/airkit/quickstart/verify-credentials) for a step-by-step walkthrough
