# Client Configuration

The Verifier Client library simplifies backend integration by handling communication with the Verifier Service and managing credential validation flows.

## Installation

```bash
npm install @empe/verifier-client
```

## Configuration Example

Define a configuration object that includes base URLs, secrets, and verification flows:

```typescript
import { VerifierConfiguration } from '@empe/verifier-client';

const verifierClientConfiguration: VerifierConfiguration = {
  baseUrl: 'https://your-app.example.com',
  verifierServiceUrl: 'https://your-verifier.evdi.app',
  clientSecret: 'your-secure-client-secret',
  verificationFlows: [
    {
      name: 'passwordless-login',
      vpQuery: [],
      handleVerificationResult: (data) => {
        // Return tokens, redirect URLs, or other logic upon verification
        return {
          verification_status: data.verification_status,
          access_token: 'generated-access-token',
          redirect_url: '/dashboard'
        };
      },
      validity: 300
    }
  ]
};
```

## Usage

Integrate the Verifier Client into your server application:

```typescript
import express from 'express';
import { VerifierClient } from '@empe/verifier-client';

const app = express();
const verifierClient = new VerifierClient(app, verifierClientConfiguration);
verifierClient.initialize();

app.listen(3000, () => console.log('Server running at http://localhost:3000'));
```

The Verifier Client sets up routes for QR code authorization, SSE connections, and callback handling. Your front-end and wallets then interact with these endpoints seamlessly.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.empe.io/develop/verifier/client-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
