This repository contains examples of how to build on and use the Kadence public API. This repository is meant to be used as a reference for developers who are looking to build on the Kadence public API.
The sample application(s) in this repository utilises the following technologies:
We've deliberately kept the sample application(s) as simple as possible to make it easier to understand the code. That's why this is written in pure JavaScript and not utilising any frameworks like Angular, React or Vue. You shouldn't need to be an expert in any of these technologies to understand the code.
To get started, you'll need to have Node.js installed on your machine. You can download Node.js from here. Once you have Node.js installed, you can clone this repository and install the dependencies by running the following commands:
git clone git@github.com:wearekadence/kadence-public-api-examples.git
or if you prefer to use HTTPS:
git clone https://github.com/wearekadence/kadence-public-api-examples.git
Once you've cloned the repository, you can install the dependencies by running the following command:
cd kadence-public-api-examples
npm install
Before you can run the application, you'll need to set the following environment variables:
Variable | Description |
---|---|
KADENCE_API_KEY_IDENTIFIER |
Your Kadence API key identifier |
KADENCE_API_KEY_SECRET |
Your Kadence API key secret |
i.e. on Linux or macOS:
export KADENCE_API_KEY_IDENTIFIER=your-api-key
export KADENCE_API_KEY_SECRET=your-api-secret
or on Windows:
set KADENCE_API_KEY_IDENTIFIER=your-api-key
set KADENCE_API_KEY_SECRET=your-api-secret
To set up an API key and secret, you can consult the following help article: How To Create an API Key?
To start the application, run the following command:
npm start
You should now be able to access the application at http://localhost:3000 from your web browser (or whatever port is next available sequentially). You'll see output in the terminal window that looks like this:
> kadence-public-api-examples@1.0.0 start
> node index.js
Kadence - Public API Examples - Running on port 3000
http://localhost:3000