Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation & Setup

Note

If you have not yet installed the Zizq server, follow the Getting Started guide first.

The official Zizq Node Client is available on npm. Install it with your package manager of choice:

$ npm install @zizq-labs/zizq

or

$ yarn add @zizq-labs/zizq

Versioning

Zizq client libraries are versioned with the same version numbers as the Zizq server, which follows the SemVer structure [MAJOR].[MINOR].[PATCH].

Whenever a new version of the server is released, client libraries with the same major and minor version numbers are also released. In short, provided the major versions match between the client and server, the client should generally have an equal or lower minor version number than the server. Patch numbers are insignficant.

The client should never exceed the server’s major and minor version because it likely expects functionality that does not exist on the server.

Examples:

Server VersionClient VersionSupported
0.1.00.1.0
0.5.120.3.7
1.0.10.12.2
0.5.120.5.23
0.5.120.6.0

Configuration

Zizq’s Node client is configured by constructing a Client instance with the desired options. There is no global configuration object.

Tip

The best-practice way to do this is by specifying environment variables that your application reads and uses to set each configuration option. That is left as an exercise for the reader. Examples here are hard-coded for clarity.

import { Client } from "@zizq-labs/zizq";

const client = new Client({
  url: "https://host.your.network:7890",
  format: "json",
  tls: {
    ca: fs.readFileSync("/path/to/server-ca-cert.pem"),
  },
});

Caution

If your server is exposed directly to the internet, it should be using Mutual TLS, otherwise anybody can communicate with it.

Options

Option Description
url
string
The base URL of the Zizq server.
tls
object
TLS options if the server is secured by TLS.
tls.ca
string
PEM-encoded string containing the server's certificate authority (for manually generated certificates, such as those generated by zizq tls).
tls.cert
string
PEM-encoded string containing the client certificate for Mutual TLS authentication if enabled on the server. Requires a pro license.
tls.key
string
PEM-encoded string containing the private key for Mutual TLS authentication if enabled on the server.
format
string
The communication format used between the Zizq client and the server. One of:
  • "json"
  • "msgpack"
Default: "json".