Send queries to the Spinque Query API using fetch.

Constructors

Properties

api?: string

Name of the API that is provided by the workspace. The Spinque Desk administrator working on your project knowns this value.

baseUrl: string = DEFAULT_BASE_URL

URL to the Spinque Query API deployment.

https://rest.spinque.com/
config?: string = 'default'

Name of the configuration of the Spinque workspace that should be used. Usually, this is something like 'production', 'development' or 'default'. The Spinque Desk administrator working on your project knowns this value.

default
version?: string = '4'

Version of the Spinque Query API deployment.

4
workspace?: string

Name of the Spinque workspace that should be addressed. The Spinque Desk administrator working on your project knowns this value.

Accessors

  • get accessToken(): undefined | string
  • Returns undefined | string

Methods

  • Fetch a url directly, circumventing all Api configuration except authentication. Useful when wanting to tap into @spinque/query-api's authentication service while also wanting to construct your own URLs. This function does not check whether the provided URL is a valid request to Spinque, take caution.

    Type Parameters

    Parameters

    • url: string
    • requestInit: RequestInit = {}

    Returns Promise<R>