This file contains information useful for contributing to the Krenalis Node.js SDK.
To test the SDK:
-
Make sure Node.js and NPM are installed. Install Node.js.
-
Install the dependencies:
npm install -
Run the tests:
npm test
To run the sample application:
-
Make sure Node.js and NPM are installed. Install Node.js.
-
Install the dependencies:
npm install -
In
sample.js, set theWRITE_KEYandENDPOINTconstants using values from a Krenalis Node.js source. -
If you are running the sample against a local Krenalis server with a self-signed certificate, the sample application needs to trust the certificate authority (CA). For this purpose, before running the application:
-
Option 1: Set the
CA_PATHenvironment variable to point to the root CA used by mkcert or any other self-signed certificate authority. For example, on Linux/macOS:export CA_PATH="$HOME/.local/share/mkcert/rootCA.pem"
On Windows (PowerShell):
$env:CA_PATH = "$env:LOCALAPPDATA\mkcert\rootCA.pem"
-
Option 2: Use the default mkcert root CA
IfCA_PATHis not set, the sample application will automatically try to detect the mkcert root CA in the standard location. Make suremkcertis installed and has generated a root CA (mkcert -install).
⚠️ If the CA is not found, TLS verification will fail, and you will see an error when running the application. -
-
Run the application:
node sample/sample.js -
You should see new logged events in the event debugger of the Krenalis Node.js source.