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 Version | Client Version | Supported |
|---|---|---|
| 0.1.0 | 0.1.0 | ✅ |
| 0.5.12 | 0.3.7 | ✅ |
| 1.0.1 | 0.12.2 | ❌ |
| 0.5.12 | 0.5.23 | ✅ |
| 0.5.12 | 0.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 |
|---|---|
urlstring |
The base URL of the Zizq server. |
tlsobject |
TLS options if the server is secured by TLS. |
tls.castring |
PEM-encoded string containing the server's certificate
authority (for manually generated certificates,
such as those generated by zizq tls).
|
tls.certstring |
PEM-encoded string containing the client certificate for Mutual TLS authentication if enabled on the server. Requires a pro license. |
tls.keystring |
PEM-encoded string containing the private key for Mutual TLS authentication if enabled on the server. |
formatstring |
The communication format used between the Zizq client and the
server. One of:
"json".
|