---
title: "Client.load(importPaths, ...protoFiles) | Grafana k6 documentation"
description: "Loads and parses the protocol buffer descriptors so they are available to the client to marshal/unmarshal the correct request and response data structures for the RPC schema."
---

# Client.load(importPaths, …protoFiles)

Loads and parses the protocol buffer descriptors so they are available to the client to marshal/unmarshal the correct request and response data structures for the RPC schema.

Must be called within the [`init` phase](/docs/k6/latest/using-k6/test-lifecycle/).

Expand table

| Parameter   | Type                          | Description                                                                                                                                                                                                   |
|-------------|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| importPaths | Array&lt;string&gt; \| `null` | The paths used to search for dependencies that are referenced in import statements in proto source files. If no import paths are provided then “.” (current directory) is assumed to be the only import path. |
| protoFiles  | Array&lt;string&gt;           | [Rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters) for the list of proto files to load/parse.                                                     |

### Examples

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import grpc from 'k6/net/grpc';

const client = new grpc.Client();
client.load([], 'language_service.proto');
```

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import grpc from 'k6/net/grpc';

const client = new grpc.Client();

client.load(
  ['../googleapis/google'],
  'spanner/admin/instance/v1/spanner_instance_admin.proto',
  'spanner/admin/instance/v1/spanner_instance_admin.proto',
  'spanner/v1/spanner.proto'
);
```
