> For the complete documentation index, see [llms.txt](https://gl-docs.gitbook.io/zkpass/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gl-docs.gitbook.io/zkpass/zkpass-developers-guide/api-reference/typescript/classes/class-dvrmoduleclient.md).

# Class: DvrModuleClient

Client class for the DVR module, accessing the DVR module functions

### Table of contents

#### Constructors

* [constructor](#constructor)

#### Properties

* [credentials](#credentials)
* [library](#library)
* [PACKAGE\_NAME](#package_name)
* [LIBRARY\_NAME](#library_name)

#### Methods

* [loadLibrary](#loadlibrary)
* [callDvrGenerateUserDataToken](#calldvrgenerateuserdatatoken)
* [callDvrGenerateQueryToken](#calldvrgeneratequerytoken)
* [callDvrGenerateZkPassProof](#calldvrgeneratezkpassproof)
* [callDvrVerifyZkPassProof](#calldvrverifyzkpassproof)

### Constructors

#### constructor

* **new DvrModuleClient**(`config`): `DvrModuleClient`

Constructs a new instance of the DvrModuleClient.

**Parameters**

<table><thead><tr><th>Name</th><th width="256">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>config</code></td><td><code>PrivacyAppClientConfig</code></td><td>Configuration object</td></tr><tr><td><code>config.baseUrl</code></td><td><code>string</code></td><td>The base URL for the API</td></tr><tr><td><code>config.apiKey</code></td><td><code>string</code></td><td>The API key for authentication</td></tr><tr><td><code>config.secretApiKey</code></td><td><code>string</code></td><td>The secret API key for authentication</td></tr></tbody></table>

**Returns**

[`DvrModuleClient`](/zkpass/zkpass-developers-guide/api-reference/typescript/classes/class-dvrmoduleclient.md)

### Properties

#### credentials

* `private` **credentials**: `PrivacyAppCredentialsStruct`

The credentials structure containing authentication details for the Privacy App Client, including base URL, API key, and secret API key.

***

#### library

* `private` **library**: `ReturnType`\<typeof [`loadLibrary`](#loadlibrary)>

The loaded library instance containing the foreign function interface (FFI) definitions for DVR module functions.

***

#### PACKAGE\_NAME

* `private` **PACKAGE\_NAME**: `"@zkpass/dvr-client-ts"` : `string`

The NPM package name for the DVR client TypeScript library.

***

#### LIBRARY\_NAME

* `private` **LIBRARY\_NAME**: `"libdvr_client.so"` : `string`

The name of the shared library file that contains the DVR client implementation.

### Methods

#### loadLibrary

▸ `private` **loadLibrary**(): `Object`

Loads the specified library and defines the foreign function interface (FFI) for the DVR module.

**Returns**

`Object` - An object representing the loaded library with the defined FFI functions

The following functions are defined in the FFI:

* `dvr_generate_user_data_token`
* `dvr_generate_query_token`
* `dvr_generate_zkpass_proof`
* `dvr_verify_zkpass_proof`

***

#### callDvrGenerateUserDataToken

▸ **callDvrGenerateUserDataToken**(`signingKey`, `stringifiedUserData`, `verifyingKeyOptionParam`): `string`

Generates a user data JWS token using the provided signing key, user data, and public key option.

**Parameters**

| Name                      | Type                        | Description                                      |
| ------------------------- | --------------------------- | ------------------------------------------------ |
| `signingKey`              | `string`                    | The key used to sign the user data token         |
| `stringifiedUserData`     | `string`                    | The user data in stringified format              |
| `verifyingKeyOptionParam` | `PublicKeyOrKeysetEndpoint` | The associated key to verify the user data token |

**Returns**

`string` - The generated user data token, or throws an error if generation fails

***

#### callDvrGenerateQueryToken

▸ **callDvrGenerateQueryToken**(`signingKey`, `dvrData`): `string`

Generates a DVR query JWS token using the provided signing key and DVR data.

**Parameters**

| Name         | Type      | Description                                          |
| ------------ | --------- | ---------------------------------------------------- |
| `signingKey` | `string`  | The key used to sign the DVR query                   |
| `dvrData`    | `DvrData` | The data required for generating the DVR query token |

**Returns**

`string` - The generated DVR query token, or throws an error if generation fails

***

#### callDvrGenerateZkPassProof

▸ **callDvrGenerateZkPassProof**(`stringifiedUserDataTokens`, `dvrtoken`): `string`

**Parameters**

| Name                        | Type     | Description                                                                  |
| --------------------------- | -------- | ---------------------------------------------------------------------------- |
| `stringifiedUserDataTokens` | `string` | Stringified representation of multiple user data tokens using tag as the key |
| `dvrtoken`                  | `string` | The DVR token to be used in the proof generation                             |

**Returns**

`string` - The generated zkPass proof, or throws an error if generation fails

***

#### callDvrVerifyZkPassProof

▸ **callDvrVerifyZkPassProof**(`zkvm`, `zkPassProofToken`, `expectedMetaData`): `VerifyZkPassProofResult`

**Parameters**

| Name               | Type                  | Description                                    |
| ------------------ | --------------------- | ---------------------------------------------- |
| `zkvm`             | `string`              | The zkVM identifier                            |
| `zkPassProofToken` | `string`              | The zkPass proof token to be verified          |
| `expectedMetaData` | `ExpectedDvrMetadata` | The expected metadata for the DVR verification |

**Returns**

`VerifyZkPassProofResult` - The output committed into the zkPass proof, and the zkPass proof data
