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

# GPUdbOptions

> GPUdbOptions — Kinetica TypeScript API

Configuration options for GPUdb client.

interface GPUdbOptions \{\
&#x20;[client\_name](#client_name)?: string;\
&#x20;[client\_version](#client_version)?: string;\
&#x20;[encoding](#encoding)?: "binary" | "json";\
&#x20;[force\_infinity\_nan\_conversion\_to\_null](#force_infinity_nan_conversion_to_null)?: boolean;\
&#x20;[getCookie](#getcookie)?: () => string | undefined;\
&#x20;[ha\_failover\_order](#ha_failover_order)?: "sequential" | "random";\
&#x20;[headers](#headers)?: Record\<string, string>;\
&#x20;[job\_endpoints](#job_endpoints)?: boolean | string\[];\
&#x20;[job\_timeout](#job_timeout)?: number;\
&#x20;[max\_response\_bytes](#max_response_bytes)?: number;\
&#x20;[oauth\_token](#oauth_token)?: string;\
&#x20;[password](#password)?: string;\
&#x20;[session\_id](#session_id)?: string;\
&#x20;[setCookie](#setcookie)?: (cookie: string | undefined) => void;\
&#x20;[sync](#sync)?: boolean;\
&#x20;[timeout](#timeout)?: number;\
&#x20;[transport](#transport)?: [HttpTransport](https://docs.kinetica.com/content/api/typescript/interfaces/HttpTransport.md);\
&#x20;[username](#username)?: string;\
}

<ul>
  <li>Defined in [src/GPUdb.ts:235](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L235)</li>
</ul>

##### Index

### Properties

[client\_name?](#client_name) [client\_version?](#client_version) [encoding?](#encoding) [force\_infinity\_nan\_conversion\_to\_null?](#force_infinity_nan_conversion_to_null) [getCookie?](#getcookie) [ha\_failover\_order?](#ha_failover_order) [headers?](#headers) [job\_endpoints?](#job_endpoints) [job\_timeout?](#job_timeout) [max\_response\_bytes?](#max_response_bytes) [oauth\_token?](#oauth_token) [password?](#password) [session\_id?](#session_id) [setCookie?](#setcookie) [sync?](#sync) [timeout?](#timeout) [transport?](#transport) [username?](#username)&#x20;

## Properties

### `Optional`client\_name

client\_name?: string

Name of the calling application, prefixed to the User-Agent header. Node.js only: browsers forbid setting User-Agent.

<ul>
  <li>Defined in [src/GPUdb.ts:325](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L325)</li>
</ul>

### `Optional`client\_version

client\_version?: string

Version of the calling application; used with `client_name`

<ul>
  <li>Defined in [src/GPUdb.ts:327](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L327)</li>
</ul>

### `Optional`encoding

encoding?: "binary" | "json"

How requests and responses are encoded: `'json'`, the default, or `'binary'` for Avro, the encoding the Java and Python APIs use. Also reachable as `GPUdb.ENCODING.{JSON,BINARY}`.Avro payloads are smaller and quicker to encode and decode, which counts most when inserting and reading records. Under `'binary'`:

<ul>
  <li>Records passed to `insert_records` and `update_records` are encoded with the table's type. The client looks it up with `show_table` on the first insert into each table and caches it; see [GPUdb.clear\_type\_cache](https://docs.kinetica.com/content/api/typescript/classes/GPUdb/clear-type-cache.md#clear_type_cache).</li>
  <li>Records from `get_records`, and the column-major data of `execute_sql`, `aggregate_group_by`, `aggregate_unique`, `aggregate_unpivot` and `get_records_by_column`, are decoded with the schema the server returns alongside them.</li>
  <li>Values must match their column types exactly. A number given for a string column, or a record missing a non-nullable column, is rejected with an `AvroError` naming the field, before anything is sent.</li>
  <li>A long outside Number's safe-integer range decodes to a `bigint`, in records and response fields alike, rather than losing precision. Note that `JSON.stringify` throws on a `bigint`.</li>
  <li>Infinity, -Infinity and NaN decode as numbers, where JSON returns them as quoted strings. `force_infinity_nan_conversion_to_null` turns them into null under either encoding.</li>
  <li>A bytes column decodes to a `Uint8Array`.</li>
  <li>Endpoints in `JSON_ONLY_ENDPOINTS` (file transfer, jobs, procs, visualization) stay JSON. So does the record data of `get_records_by_series` and `get_records_from_collection`, which travels as JSON inside the Avro envelope.</li>
</ul>

A custom [GPUdbOptions.transport](#transport) is handed binary request bodies in `HttpRequestOptions.bytes` rather than `body`, and must send them unchanged.

<ul>
  <li>Defined in [src/GPUdb.ts:406](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L406)</li>
</ul>

### `Optional`force\_infinity\_nan\_conversion\_to\_null

force\_infinity\_nan\_conversion\_to\_null?: boolean

Convert the quoted "Infinity", "-Infinity" and "NaN" strings Kinetica returns for those values into null when decoding a payload.Kinetica sends them quoted, so a `double` column holding one decodes to the JavaScript string "Infinity" rather than a number. Set this to get null instead. Off by default: the conversion walks every key and value of the payload, which the JavaScript API also considered too expensive to make unconditional.Equivalent to `force_infinity_nan_conversion_to_null` on the JavaScript API's client, and settable after construction in the same way.

<ul>
  <li>Defined in [src/GPUdb.ts:348](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L348)</li>
</ul>

### `Optional`getCookie

getCookie?: () => string | undefined

Returns the Cookie header to send with each request. Node.js only: browsers manage cookies themselves and forbid setting the header.

<ul>
  <li>Defined in [src/GPUdb.ts:332](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L332)</li>
</ul>

### `Optional`ha\_failover\_order

ha\_failover\_order?: "sequential" | "random"

Order in which clusters are taken from the supplied URL list, for both the initial cluster and the one chosen on failover.`'sequential'`, the default, uses the caller's order, so the initial cluster is the first URL. `'random'` shuffles, randomizing both the initial choice and the failover sequence. Also reachable as `GPUdb.HA_FAILOVER_ORDER.{SEQUENTIAL,RANDOM}`.

<ul>
  <li>Defined in [src/GPUdb.ts:370](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L370)</li>
</ul>

### `Optional`headers

headers?: Record\<string, string>

Custom HTTP headers

<ul>
  <li>Defined in [src/GPUdb.ts:303](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L303)</li>
</ul>

### `Optional`job\_endpoints

job\_endpoints?: boolean | string\[]

Endpoints to submit through `/create/job` and poll, rather than calling directly. `false`, the default, calls every endpoint directly.A long ALTER can outlast a proxy's idle timeout, and running it as a job keeps the HTTP request short. That only helps where such a proxy exists: a client talking to Kinetica directly pays two extra round trips, and [JOB\_POLL\_INTERVAL](#job_timeout) is 5 s, so an ALTER that finishes in milliseconds either costs one extra request or waits out a full poll interval. Off by default for that reason, and because neither the JavaScript nor the Python API wraps these endpoints -- a client that did so silently would diverge from every other Kinetica API.`true` uses [GPUdb.DEFAULT\_JOB\_ENDPOINTS](https://docs.kinetica.com/content/api/typescript/classes/GPUdb/static-default-job-endpoints.md#default_job_endpoints). An array names the endpoint paths to wrap, for a deployment whose proxy cuts off other endpoints too.Set [GPUdbOptions.job\_timeout](#job_timeout) alongside this, or a job that never finishes is polled forever.

#### Example

```
// Behind a gateway that times out long requests
new GPUdb(url, { job_endpoints: true, job_timeout: 300000 });

// A specific set
new GPUdb(url, { job_endpoints: ['/alter/table'] });
```

<ul>
  <li>Defined in [src/GPUdb.ts:273](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L273)</li>
</ul>

### `Optional`job\_timeout

job\_timeout?: number

How long to keep polling a job-wrapped endpoint, in milliseconds. 0, the default, means no deadline.`timeout` bounds each individual HTTP request; it does not bound the polling loop behind `/alter/table`, which would otherwise wait for a job that never finishes with no way for the caller to give up. This is a separate option rather than an inheritance of `timeout` because outlasting a per-request timeout is the whole reason those endpoints are wrapped in a job -- an ALTER over a large table is expected to take longer.On expiry the call rejects. The job itself keeps running on the server.

<ul>
  <li>Defined in [src/GPUdb.ts:287](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L287)</li>
</ul>

### `Optional`max\_response\_bytes

max\_response\_bytes?: number

Largest response body to accept, in bytes. 0, the default, means no ceiling.A single unbounded `execute_sql` can return more than the process has memory for, and the failure that follows is an out-of-memory kill rather than a caught error. With this set the read is abandoned as soon as the body passes the limit and the call rejects with a `ResponseTooLargeError`, which names the limit and what was received.The request is not retried against another URL: an oversized result follows from the query, not from the node that served it.

<ul>
  <li>Defined in [src/GPUdb.ts:301](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L301)</li>
</ul>

### `Optional`oauth\_token

oauth\_token?: string

OAuth2 token for authentication

<ul>
  <li>Defined in [src/GPUdb.ts:241](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L241)</li>
</ul>

### `Optional`password

password?: string

Password for authentication

<ul>
  <li>Defined in [src/GPUdb.ts:239](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L239)</li>
</ul>

### `Optional`session\_id

session\_id?: string

The server session this client's SQL `#name` temp tables belong to, so that several clients can share one session's temp tables.The caller must drop that session, by calling `drop_session()` on a client given the same session ID; [GPUdb.close](https://docs.kinetica.com/content/api/typescript/classes/GPUdb/close.md#close) does not. If unset or empty (the default), each client has a session of its own, which its `close()` drops. A session ID may contain only letters, digits and `-`, as a UUID does; the server refuses any other.

<ul>
  <li>Defined in [src/GPUdb.ts:314](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L314)</li>
</ul>

### `Optional`setCookie

setCookie?: (cookie: string | undefined) => void

Receives the Set-Cookie header from each response

<ul>
  <li>Defined in [src/GPUdb.ts:334](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L334)</li>
</ul>

### `Optional`sync

sync?: boolean

Block instead of returning a promise when no callback is given, restoring the JavaScript API's synchronous browser behaviour.Requires a transport with a synchronous mode -- in practice BrowserHttpTransport, which falls back to a blocking XMLHttpRequest. Defaults to false everywhere except the standalone browser build.Synchronous requests block the UI thread and are deprecated by browsers; treat this as a migration aid, not a long-term setting.

<ul>
  <li>Defined in [src/GPUdb.ts:360](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L360)</li>
</ul>

### `Optional`timeout

timeout?: number

Request timeout in milliseconds (0 = infinite)

<ul>
  <li>Defined in [src/GPUdb.ts:243](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L243)</li>
</ul>

### `Optional`transport

transport?: [HttpTransport](https://docs.kinetica.com/content/api/typescript/interfaces/HttpTransport.md)

HTTP transport to use. Defaults to `fetch` in the browser and the `http`/`https` modules under Node.js. Supply one to route requests through a proxy, add instrumentation, or stub the network in tests.

<ul>
  <li>Defined in [src/GPUdb.ts:320](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L320)</li>
</ul>

### `Optional`username

username?: string

Username for authentication

<ul>
  <li>Defined in [src/GPUdb.ts:237](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L237)</li>
</ul>


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