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

# Quickstart

> Install @deepidv/server, initialize the client, and get identity verification results in under two minutes.

Get from zero to a verification result in under two minutes.

## 1. Install

```bash npm theme={null}
npm install @deepidv/server
```

```bash pnpm theme={null}
pnpm add @deepidv/server
```

```bash yarn theme={null}
yarn add @deepidv/server
```

```bash bun theme={null}
bun add @deepidv/server
```

## 2. Initialize the client

Create one client and reuse it across requests. The API key is read from an environment variable — never hardcode it.

```typescript theme={null}
import { DeepIDV } from '@deepidv/server';

const client = new DeepIDV({
  apiKey: process.env.DEEPIDV_API_KEY!,
});
```

> [!TIP]
>
> Get an API key from the [API Authentication](https://docs.deepidv.com/authentication.md) page in your deepidv account.

## 3. Create a verification session

The fastest path to a verified identity — create a hosted session and send the user to the returned URL:

```typescript theme={null}
const session = await client.sessions.create({
  firstName: 'Jane',
  lastName: 'Doe',
  email: 'jane@example.com',
  phone: '+15551234567',
});

console.log(session.sessionUrl);
// → "https://verify.deepidv.com/session/abc123"
// Send this URL to your user
```

When the user finishes, retrieve the result with `client.sessions.retrieve(session.id)`. See the [Session Verification guide](https://docs.deepidv.com/integrate/sdks/typescript/server/session-verification.md) for the full flow.

## Prefer to build your own flow?

If you handle the applicant UI yourself, call the primitives directly.

### Scan a document

```typescript theme={null}
import { readFileSync } from 'node:fs';

const result = await client.document.scan({
  image: readFileSync('drivers-license.jpg'),
});

console.log(result.fullName); // "Jane Doe"
console.log(result.dateOfBirth); // "1990-01-15"
console.log(result.documentNumber); // "D1234567"
console.log(result.confidence); // 0.97
```

### Compare two faces

```typescript theme={null}
const match = await client.face.compare({
  source: readFileSync('id-photo.jpg'),
  target: readFileSync('selfie.jpg'),
});

console.log(match.isMatch); // true
console.log(match.confidence); // 94 (0–100 scale)
```

### Full identity verification

Document scan + face detection + face comparison in a single call:

```typescript theme={null}
const verification = await client.identity.verify({
  documentImage: readFileSync('passport.jpg'),
  faceImage: readFileSync('selfie.jpg'),
});

console.log(verification.verified); // true
console.log(verification.overallConfidence); // 96
console.log(verification.document.fullName); // "Jane Doe"
console.log(verification.faceMatch.isMatch); // true
```

## Next steps

> [card] [Authentication](https://docs.deepidv.com/integrate/sdks/typescript/server/authentication.md)
>
> API key setup and security best practices.

> [card] [Configuration](https://docs.deepidv.com/integrate/sdks/typescript/server/configuration.md)
>
> Timeouts, retries, base URL, and custom fetch.

> [card] [Server-to-Server](https://docs.deepidv.com/integrate/sdks/typescript/server/server-to-server.md)
>
> Build a custom verification pipeline.

> [card] [Error Handling](https://docs.deepidv.com/integrate/sdks/typescript/server/error-handling.md)
>
> Typed errors, the decision tree, and retry semantics.


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