Class

Client

Client

The client is a low level wrapper around API calls to the Quintype API. The client object is usually created for you by the malibu framework. The majority of functions on Client are not documented as they are not meant for external use. Instead, please use the higher level APIs on Story, Collection or other entity.

If needed, a client can be created with the buildClient method.

Methods

getConfig() → {Promise.<Config>}

This can be used to get the current config for this publisher this client points to. By default, this reloads every 2 minutes. You will not typically need to call this method, as @quintype/framework does this for you.

View Source index.js, line 760

A Promise that returns an instance of Config

Promise.<Config>

getHostname() → {string}

Get the hostname this client is currently pointed to. Usually, http://xyz.internal.quintype.io

View Source index.js, line 690

Hostname

string

request(path, opts) → {Promise.<Response>}

Low level API for making a request to the backend. This API is not intended to be used by app developers.

Parameters:
Name Type Description
path string

The path of the API, usually starting /api/v1

opts Object

options that passed directly to request

method string

The HTTP method to be called (default 'GET')

qs Object

An object of query parameters to be passed to the backend

body string

The body of the request (for POST requests only)

View Source index.js, line 708

A promise of the response

Promise.<Response>