Privakey Documentation

Welcome to Privakey's documentation pages. You'll find comprehensive documentation and guides to help you start working with Privakey as quickly as possible. If you can't find the help you need, feel free to reach out to

Get Started    API Reference



An internet accessible server with:

  • Node 8.11
  • NPM, installed globally
  • OpenSSL
  • Firebase Project and Credential
    • Privakey uses Firebase by default for notification delivery. Support for other frameworks can be added if necessary.
  • MySQL 5.7
    • With minimal support from Privakey, other relational databases can be supported.
  • SSL protected endpoints
    • If SSL is managed by the Node server (versus, for example, a load balancer or reverse proxy) SSL certificates will need to be acquired, stored and referenced in environment variables.

Database Installation

  1. Initialize the Database
    1. Create the database:
      1. Default Name: privakey_cx
      2. Create a user with read / write access to run initial scripts
      3. This user can also be used for Auth Service access, alternatively, you can create a distinct user for Auth Service access to the DB.
    2. Run DB Scripts
      1. Scripts are found in <PrivakeyCX root>/sql directory
      2. Execute privakeycx.sql first. (items in this file should not be changed)
      3. Execute insert_constants.sql (items in this file should not be changed)
      4. Execute config_table_values.sql script.

Server Installation

  1. Copy the PrivakeyCX Auth Service distribution to the server.
  2. Run npm install --production from the project root.
  3. Generate a signing certificate on the Node Server.
    From within the root of the PrivakeyCX directory, execute the following commands:
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 1000 -out certificate.pem 
-sha256 -subj "/CN=localhost"

openssl pkcs12 -inkey key.pem -in certificate.pem -export -out privakeyservice.pfx

Make a note of the password used during this step, as it will need to be saved in an environment variable later.

  1. Review and set Config Values in config.json found in the project’s root directory


The port the service will run on.


Options include: off, error, warn, info, verbose, debug or silly.


Path and name of where the file should be generated, relative to project root.


Maximum, overall size of generateRequest object allowable.
Reccomended size: 2mb


The path, relative to the project root of the signing certificate generated in Step 3.

Set up initial Environment Variables:

Value / Value Description


The password for the certificate created in step 3.


The path to the Open SSL executable.
This normally can be discovered by typing which openssl at a command prompt.




Address of the DB


Port for the DB


A MySQL user with read / write access to DB set up in step 1 of the Database Installation.


Password for DATA_USER


Should not be changed unless the database script was modified with an alternate name.


Any string, used for data at rest encryption (primarily for challenge origin credential storage)


Optional. The name and path of the CX log file. The log file can also be configured through the config.json file.


The path to the Firebase credentials JSON file.
This file is generated through the Firebase console, by navigating to Project settings > Service accounts.


The Firebase database URL


true if the application is managing SSL. Otherwise, false


Required if USE_SSL is true.
./cert/server.key is the recommended location/name for this key.


Required if USE_SSL is true.
./cert/server.crt is the recommended location/name for this file.


http://[server name]:[server port]/communication/send

For example, if using CX's built-in communication service and CX is running on the default port 8080, this will be http://localhost:8080/communication/send


Generated during the bootstrapping process. See bootstrap the system



You are now ready to bootstrap the system


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.