Setup

Installation

Install the @iightcms/js-api package to your project:

npm i @iightcms/js-api

You can then create a new connection by importing iight into your project:

import iight from '@iightcms/js-api'

const connection = iight('INSERT_API_KEY')

Usage

Here’s how you can create a new connection with the iight JS API package:

import iight from '@iightcms/js-api'

const connection = iight('INSERT_API_KEY')

Authentication

API keys can be created by navigating to the API Keys screen in your project.

iight-api-keys.png

Unauthorised Request

An unauthorised request will return a 401 Unauthorized status and the body:

{
  "message": "Unauthenticated."
}

Rate Limit Exceeded

All API endpoints are limited to 60 requests per minute, per client IP. When exceeded the response will return a 429 Too Many Requests status and the body:

{
  "message": "Too Many Attempts."
}

Advanced Options