Optional
cache: CacheSets the API credentials used to authenticate against endpoints that require authentication. Not every endpoint of the CFTools Cloud API requires authentication. Where not needed, the SDK will make unauthenticated requests. Whenever an endpoint requires authentication, these credentials must be set in order for the method to succeed.
The enterprise API is functionally equal with the data API, however, it looses the rate limits and with that allows much more requests per time unit compared to the general available data API. To use it, you require an enterprise access token.
The Enterprise Access Token provided by CFTools
Allows to set the HTTP Client library builder. Intended use case is to modify the options that is passed to the built-in client builder, however, this can also be used to use your own preferred HTTP library with the sdk, as long as it adheres to the HttpClientBuilder contract.
Example use case enabling debug logging and setting your own User Agent in requests:
import {CFToolsClientBuilder, httpClient} from 'cftools-sdk';
new CFToolsClientBuilder()
.withHttpClient(() => new GotHttpClient(httpClient(false, {userAgent: 'myTool/1.0.0 (https://github.com/username/tool-repo)', enableDebugLogging: true})))
.withServerApiId(process.env.CFTOOLS_SERVER_API_ID)
.withCredentials(process.env.CFTOOLS_APPLICATION_ID, process.env.CFTOOLS_APPLICATION_SECRET)
.build()
Set the default server api ID identifying the CFTools Cloud server instance. This default API ID is not required. Methods will allow to override this default id, otherwise this ID needs to be set in order for the method to succeed.
Methods that require authentication are marked in their documentation, that they require an authenticated client.
Generated using TypeDoc
Specify the configuration of the cached CFTools client. Configuring this makes only sense when the client is configured to use a cache, otherwise this configuration is ignored.
You do not need to configure all of the CacheConfiguration options. Omitted options will be auto- completed with the default settings.