AuthHeaders

Import from @infrared-city/infrared-sdk.

AuthHeaders = Readonly<Record<string, string>>

The HTTP headers that authenticate one request.


AuthOptions

Import from @infrared-city/infrared-sdk.

Credentials and caller identity for the client.

Provide at least one of apiKey, token or getToken. token and getToken are mutually exclusive.

Extended by

Properties

PropertyModifierTypeDescription
apiKey?readonlystringAPI key, sent in the X-Api-Key header on every request.
getToken?readonly() => string \Promise<string>Returns the bearer token, called before every request so a refreshed token is picked up. Must return a non-empty string.
surface?readonlyInfraredSurfaceThe application the calls come from. Defaults to "script".
token?readonlystringA fixed bearer token (JWT), sent in the Authorization header.

AuthResolver

Import from @infrared-city/infrared-sdk.

AuthResolver = () => Promise<AuthHeaders>

Produces the authentication headers for the next request. It is evaluated on every request, so a dynamic token is always current.

Returns

Promise<AuthHeaders>


buildAuthResolver

Import from @infrared-city/infrared-sdk.

buildAuthResolver(options): AuthResolver

Build an authentication resolver that evaluates dynamic JWTs on every request.

Parameters

ParameterTypeDescription
optionsAuthOptionsThe credentials to use; see AuthOptions.

Returns

AuthResolver

A function that resolves the authentication headers for one request.

Throws

If token and getToken are both given, if no credential is given, or if getToken returns an empty or non-string value when the resolver runs.


consoleLogger

Import from @infrared-city/infrared-sdk.

const consoleLogger: Logger = console

A Logger that writes to the global console.


coreVersion

Import from @infrared-city/infrared-sdk.

coreVersion(): string

The version of the computation core bundled with this SDK.

Call initializeCore first.

Returns

string

The version string.

Throws

when the core has not been initialised.


GeometryReuseProbeEvent

Import from @infrared-city/infrared-sdk.

What the first submission that refers to previously uploaded geometry settled.

acceptedJobIds are real jobs from your own run, not extra test jobs. On "supported" it is the job whose acknowledgement confirmed that the API resolves geometry references. On "unsupported" it is the job that was accepted without a valid acknowledgement; its result is discarded and it is reported here so it can be reconciled against billing.

Properties

PropertyModifierTypeDescription
acceptedJobIdsreadonlyreadonly string\[\]Ids of the jobs that were accepted by this submission.
outcomereadonlyGeometryReuseProbeOutcomeWhether the API resolved the geometry reference.

GeometryReuseProbeOutcome

Import from @infrared-city/infrared-sdk.

GeometryReuseProbeOutcome = "supported" \| "unsupported"

Whether the API resolved a reference to previously uploaded geometry.

"supported" means it did, "unsupported" means it did not.


GeometryUrlEntry

Import from @infrared-city/infrared-sdk.

One geometry URL that a GeometryUrlStore keeps.

Properties

PropertyModifierTypeDescription
expiresAtreadonlynumberWhen the SDK stops using the URL, in milliseconds since the Unix epoch.
urlreadonlystringThe signed URL of the uploaded geometry.

GeometryUrlStore

Import from @infrared-city/infrared-sdk.

A place that keeps the URLs of uploaded tile geometry for longer than one client: for example sessionStorage, IndexedDB or a file. Give the same store to a new client (a new worker, or the page after a reload) and it does not upload the same geometry again while the URL is still valid.

The SDK makes the keys and the expiresAt values: 23 hours after the upload, or the end of the signed URL when that is earlier. A key contains the gateway URLs, a SHA-256 digest of the credentials (never the credentials) and the digest of the geometry. An entry is a read link to your geometry for its lifetime; treat the store like a cache of secrets.

Methods

claim()?

optional claim(key): Promise<() => void>

Optional. Claim key for one upload across clients that share this store (several workers, tabs or processes). Resolve when this client holds the claim, and return the function that releases it. On a get miss the SDK claims the key, calls get again (another client may have uploaded it while this one waited), uploads only on a second miss, waits for set to settle, then releases (the run itself does not wait for set). An aborted run stops waiting for the claim at once; the shared upload that other runs may wait on keeps waiting, at most 60 s, and then uploads anyway (a second upload is better than a stuck run). A claim that resolves later is released at once. A claim that throws is a miss with one warning; the SDK uploads.

Parameters
ParameterType
keystring
Returns

Promise<() => void>

Example

Web Locks, in a page or a worker

TypeScript
claim: (key) => new Promise((claimed, failed) => {
  navigator.locks.request(`ir-geom:${key}`, () => new Promise<void>((release) => claimed(release)))
    .catch(failed);
}),

get()

get(key): GeometryUrlEntry \| Promise<GeometryUrlEntry \| undefined> \| undefined

Return the entry for key, or undefined when there is none.

Parameters
ParameterType
keystring
Returns

GeometryUrlEntry \| Promise<GeometryUrlEntry \| undefined> \| undefined


set()

set(key, url, expiresAt): void \| Promise<void>

Keep url for key until expiresAt (milliseconds since the Unix epoch).

Parameters
ParameterType
keystring
urlstring
expiresAtnumber
Returns

void \| Promise<void>


InfraredClient

Import from @infrared-city/infrared-sdk.

The entry point of the SDK: runs analyses on one site or over a polygon area (split into tiles), and exposes the weather, buildings, vegetation, ground-material and billing services.

Constructors

Constructor

new InfraredClient(options?): InfraredClient

Creates a client; give a credential (apiKey, token, getToken or auth) here or through the environment.

Parameters
ParameterTypeDescription
optionsInfraredClientConfigSee InfraredClientConfig.
Returns

InfraredClient

Throws

when auth is combined with another credential, or INFRARED_GEOMETRY_REF_ENABLED is not a Boolean string.

Throws

when a removed option such as acquisition is passed.

Throws

when no credential is given.

Other

analyses

readonly analyses: AnalysisService

Submits requests that already use the API's own keys.


apiKey

readonly apiKey: string \| undefined

The API key the client was created with, if any.


baseUrl

readonly baseUrl: string

The API base URL in use, without trailing slashes.


billing

readonly billing: BillingService

The public price list.


buildings

readonly buildings: BuildingsService

Buildings around a site.


groundMaterials

readonly groundMaterials: GroundMaterialsService

Ground materials around a site.


jobs

readonly jobs: JobsService

Submits jobs, reads their status and downloads results.


logger

readonly logger: Logger

Where the SDK's warnings go.


vegetation

readonly vegetation: VegetationService

Trees around a site.


weather

readonly weather: WeatherService

Weather stations and data.


checkAreaState()

checkAreaState(schedule, options?): Promise<AreaState>

Reads the status of the schedule's jobs once, updates it and returns the run's counts.

Parameters
ParameterType
scheduleAreaSchedule
optionsCheckAreaStateOptions
Returns

Promise<AreaState>


checkPartsState()

checkPartsState(schedule, options?): Promise<AreaState>

Reads the status of every open part once; returns the run's counts.

Parameters
ParameterType
schedulePartsSchedule
optionsCheckAreaStateOptions
Returns

Promise<AreaState>


decompressResult()

decompressResult(content): unknown

Decodes an already downloaded result archive; prefer jobs.decompress, which returns a typed result.

Parameters
ParameterType
contentUint8Array
Returns

unknown


generateTiles()

generateTiles(polygon, options?): Tile\[\]\[\]

Builds the tile grid covering a polygon, south to north; sends no request.

Parameters
ParameterType
polygonPolygon
options\{ analysisType?: string; maxTilesOverride?: number; \}
options.analysisType?string
options.maxTilesOverride?number
Returns

Tile\[\]\[\]


mergeAreaJobs()

mergeAreaJobs(schedule, options?): Promise<AreaResult>

Downloads the finished grid jobs of an area run and merges them into an AreaResult. Throws when a tile did not contribute; calling it again with the same schedule completes a run whose results could not be fetched.

Parameters
ParameterType
scheduleAreaSchedule
optionsAreaMergeOptions
Returns

Promise<AreaResult>


mergeParts()

mergeParts(schedule, options?): Promise<unknown>

Downloads and joins a finished parts run; throws AnalysisPartsError naming a failed part.

Parameters
ParameterType
schedulePartsSchedule
optionsMergePartsOptions
Returns

Promise<unknown>


mergeSurfaceAreaJobs()

mergeSurfaceAreaJobs(schedule, options?): Promise<SurfaceColumns>

Downloads the finished surface jobs of an area run and joins them into SurfaceColumns.

Parameters
ParameterType
scheduleAreaSchedule
optionsPick<AreaMergeOptions, "maxWorkers" \"signal" \"logger">
Returns

Promise<SurfaceColumns>


previewArea()

previewArea(polygon, options): Promise<AreaPreview>

Estimates an area run from its tile count; submits nothing. The cost is the jobs times the API's price for the analysis (pricingSource says if the price is "live", "cached" or "stale"). For a facade run use previewAreaBatches. Throws when the polygon needs more non-empty tiles than the limit.

Parameters
ParameterType
polygonPolygon
options\{ analysisType: string; maxTilesOverride?: number; \}
options.analysisTypestring
options.maxTilesOverride?number
Returns

Promise<AreaPreview>

Throws

when the price list cannot be fetched and the client has none.

Example
TypeScript
const preview = await client.previewArea(polygon, { analysisType: "wind-speed" });

previewAreaBatches()

previewAreaBatches(input, polygon, options?): Promise<AreaBatchPreview>

Previews a facade run: builds the plan runArea would and reports its job count instead of submitting it. Pass the same input a runArea call would, because previewArea under-reports a facade (analysisSurfaces) run.

Parameters
ParameterType
inputRunAreaInput
polygonPolygon
optionsRunAreaOptions
Returns

Promise<AreaBatchPreview>


~~previewAreaWithPricing()~~

previewAreaWithPricing(polygon, options): Promise<AreaPreviewWithPricing>
Parameters
ParameterType
polygonunknown
options\{ analysisType: AnalysesName; forceRefresh?: boolean; maxTilesOverride?: number; \}
options.analysisTypeAnalysesName
options.forceRefresh?boolean
options.maxTilesOverride?number
Returns

Promise<AreaPreviewWithPricing>

Deprecated

Use previewArea: it is priced with the same price list. Removed in 2.0.


previewParts()

previewParts(input, options?): Promise<PartsPreview>

The parts, sensors and tokens a runAndWait of input would bill; sends nothing.

Parameters
ParameterType
inputReadonly<Record<string, unknown>>
optionsPartsOptions
Returns

Promise<PartsPreview>


run()

run(input, options?): Promise<Job>

Submits one analysis request and returns the accepted Job without waiting; follow with jobs.waitForCompletion, or use runAndWait. Throws a TypeError straight away, before a promise is returned, when the request is not valid; later failures reject the returned promise.

Parameters
ParameterType
inputReadonly<Record<string, unknown>>
optionsSubmitOptions
Returns

Promise<Job>

Example
TypeScript
const job = await client.run({ analysisType: AnalysesName.WindSpeed, ...parameters });

runAndWait()

runAndWait(input, options?): Promise<unknown>

Submits a request, waits for it and returns the decoded result. A daylight-factor request whose floors do not fit one job is sent as parts in parallel and joined into the result a single request would give (maxParts: 1 sends one job); any other request is one job. A daylight-factor result is a DaylightFactorResult, or the JSON value with resultFormat: "json".

Rejects when a job fails or the wait times out.

Parameters
ParameterType
inputReadonly<Record<string, unknown>>
optionsSubmitOptions & RunAndWaitOptions
Returns

Promise<unknown>

Example
TypeScript
const result = await client.runAndWait({ analysisType: AnalysesName.WindSpeed, ...parameters });

runArea()

Call Signature
runArea(input, polygon, options?): Promise<AreaSchedule>

Plans an area run over polygon, submits one job per non-empty tile and returns the saved AreaSchedule without waiting; finish it with checkAreaState and mergeAreaJobs.

A tile that fails does not stop the run. The tiles that went out before it may be billed. List the failed tiles in schedule.failedSubmissions and pass the schedule as retryFrom to send only those.

Give a list of inputs to run several analyses over the same polygon: they share one prepared site (and a facade tile's parts), and the call returns one schedule per input, in input order. retryFrom is refused with a list; retry each analysis alone.

Parameters
ParameterTypeDescription
inputRunAreaInputthe analysis request, as for runAndWait, plus the area settings, or a list of them.
polygonPolygonthe area to analyse.
options?RunAreaOptionsmaxTilesOverride, retryFrom, onAccepted, signal and logger.
Returns

Promise<AreaSchedule>

the saved AreaSchedule with one entry for each submitted tile (one schedule per input for a list).

Throws

when the polygon needs more non-empty tiles than the limit; the message gives the maxTilesOverride to pass.

Throws

when an acquired layer was read with a narrower margin than the analysis needs.

Example
TypeScript
const schedule = await client.runArea(input, polygon, { maxTilesOverride: 400 });
const [solar, wind] = await client.runArea([solarInput, windInput], polygon);
Call Signature
runArea(inputs, polygon, options?): Promise<AreaSchedule\[\]>

Plans an area run over polygon, submits one job per non-empty tile and returns the saved AreaSchedule without waiting; finish it with checkAreaState and mergeAreaJobs.

A tile that fails does not stop the run. The tiles that went out before it may be billed. List the failed tiles in schedule.failedSubmissions and pass the schedule as retryFrom to send only those.

Give a list of inputs to run several analyses over the same polygon: they share one prepared site (and a facade tile's parts), and the call returns one schedule per input, in input order. retryFrom is refused with a list; retry each analysis alone.

Parameters
ParameterTypeDescription
inputsreadonly RunAreaInput\[\]-
polygonPolygonthe area to analyse.
options?RunAreaOptionsmaxTilesOverride, retryFrom, onAccepted, signal and logger.
Returns

Promise<AreaSchedule\[\]>

the saved AreaSchedule with one entry for each submitted tile (one schedule per input for a list).

Throws

when the polygon needs more non-empty tiles than the limit; the message gives the maxTilesOverride to pass.

Throws

when an acquired layer was read with a narrower margin than the analysis needs.

Example
TypeScript
const schedule = await client.runArea(input, polygon, { maxTilesOverride: 400 });
const [solar, wind] = await client.runArea([solarInput, windInput], polygon);

runAreaAndWait()

Call Signature
runAreaAndWait(input, polygon, options?): Promise<SurfaceColumns \| AreaResult>

Runs an analysis over a polygon area and returns the merged result: it submits the tiles, waits, retries what failed (retries) and merges. A surface run returns SurfaceColumns, any other run an AreaResult. areaTimeout is in seconds, default 3600.

Give a list of inputs to run several analyses over the same polygon in ONE run: they share the prepared site and a facade tile's parts, and the call returns one result per input, in input order, when every analysis is finished. When one failed, the first error in input order is thrown. runAreaStream hands each result over the moment it is finished.

Parameters
ParameterType
inputRunAreaInput
polygonPolygon
options?RunAreaAndWaitOptions
Returns

Promise<SurfaceColumns \| AreaResult>

Throws

when the run does not finish within areaTimeout.

Throws

when a tile failed, a finished job did not download, or a submit is uncertain.

Throws

when a status request is refused for good (for example HTTP 403).

Throws

when areaTimeout is not a positive finite number.

Example
TypeScript
const result = await client.runAreaAndWait(input, polygon, { areaTimeout: 1800 });
const [solar, svf] = await client.runAreaAndWait([solarInput, svfInput], polygon);
Call Signature
runAreaAndWait(inputs, polygon, options?): Promise<(SurfaceColumns \| AreaResult)\[\]>

Runs an analysis over a polygon area and returns the merged result: it submits the tiles, waits, retries what failed (retries) and merges. A surface run returns SurfaceColumns, any other run an AreaResult. areaTimeout is in seconds, default 3600.

Give a list of inputs to run several analyses over the same polygon in ONE run: they share the prepared site and a facade tile's parts, and the call returns one result per input, in input order, when every analysis is finished. When one failed, the first error in input order is thrown. runAreaStream hands each result over the moment it is finished.

Parameters
ParameterType
inputsreadonly RunAreaInput\[\]
polygonPolygon
options?RunAreaAndWaitOptions
Returns

Promise<(SurfaceColumns \| AreaResult)\[\]>

Throws

when the run does not finish within areaTimeout.

Throws

when a tile failed, a finished job did not download, or a submit is uncertain.

Throws

when a status request is refused for good (for example HTTP 403).

Throws

when areaTimeout is not a positive finite number.

Example
TypeScript
const result = await client.runAreaAndWait(input, polygon, { areaTimeout: 1800 });
const [solar, svf] = await client.runAreaAndWait([solarInput, svfInput], polygon);

runParts()

runParts(input, options?): Promise<PartsSchedule>

Submits a request as its parts without waiting; returns the saved PartsSchedule.

Parameters
ParameterType
inputReadonly<Record<string, unknown>>
optionsPartsOptions
Returns

Promise<PartsSchedule>

Run an analysis

runAreaStream()

runAreaStream(inputs, polygon, options?): AsyncGenerator<AreaStreamItem, void, undefined>

Runs analyses over one polygon area as runAreaAndWait does, and yields each result the moment its last tile is merged, in the order they finish. Read the items one by one: the SDK keeps no reference to a yielded result. A failed analysis yields an item with error; the others continue. break or options.signal cancels the analyses not yet yielded. options apply to every analysis; onProgress reports each analysis until it is finished (then its bodies are freed).

Parameters
ParameterType
inputsRunAreaInput \readonly RunAreaInput\[\]
polygonPolygon
optionsRunAreaAndWaitOptions
Returns

AsyncGenerator<AreaStreamItem, void, undefined>

Throws

on the first next() when areaTimeout is not a positive finite number.

Example
TypeScript
for await (const item of client.runAreaStream([solar, wind], polygon)) draw(item);

InfraredClientConfig

Import from @infrared-city/infrared-sdk.

Settings for new InfraredClient(config). Give at least one credential: apiKey, token or getToken (inherited from the authentication options), or a custom auth.

Extends

Properties

PropertyModifierTypeDescriptionInherited from
apiKey?readonlystringAPI key, sent in the X-Api-Key header on every request.AuthOptions.apiKey
auth?readonlyAuthResolverA custom function that supplies the request headers carrying the credentials. It cannot be combined with apiKey, token or getToken.-
baseUrl?readonlystring \URLThe API base URL. Defaults to INFRARED_BASE_URL, then https://api.infrared.city/v2.-
batchSubmit?readonlybooleanSend the jobs of a binary area run in batch submits of up to 100 jobs when the API offers them: fewer requests, the same jobs. Each job keeps its own key and its own charge. Default true with apiKey or token; a client with getToken or auth sends one request per job, and so does false.-
bigPayloadThresholdBytes?readonlynumberRequest archives larger than this many bytes are uploaded separately instead of being sent in the request. A non-negative whole number; default 5 MiB (5 242 880).-
downloadTimeout?readonlynumberAlias of downloadTimeoutMs, also in milliseconds; downloadTimeoutMs wins when both are given.-
downloadTimeoutMs?readonlynumberTimeout for each result download, in milliseconds. Default 600 000.-
env?readonlyInfraredEnvBindingsEnvironment values to use in place of process.env.-
fetch?readonly\{(input, init?): Promise<Response>; (input, init?): Promise<Response>; \}The fetch implementation to use for requests. Defaults to the global fetch.-
gatewayBaseUrl?readonlystring \URLThe base URL that large request archives are uploaded through. Defaults to baseUrl.-
geometryUrlStore?readonlyGeometryUrlStoreKeeps the URLs of uploaded tile geometry outside this client, so a new client (a new worker, or the page after a reload) does not upload the same geometry again while its signed URL is still valid. Before an upload the SDK looks in its own memory, then calls get once per geometry; after an upload it calls set. The SDK makes the keys (they contain a digest of the credentials, never the credentials) and the expiresAt values (23 h after the upload, or the signed URL's end when earlier). When the server refuses a stored URL, the SDK uploads again and overwrites the entry. A get or set that throws or hangs gives one warning and an upload; the run does not fail. An entry is a read link to your geometry for its lifetime; treat the store like a cache of secrets. Default: no store, the URLs stay in this realm's memory only. Example const client = new InfraredClient({ apiKey, geometryUrlStore: { get: (key) => JSON.parse(sessionStorage.getItem(ir:${key}) ?? "null") ?? undefined, set: (key, url, expiresAt) => sessionStorage.setItem(ir:${key}, JSON.stringify({ url, expiresAt })), }, });-
getToken?readonly() => string \Promise<string>Returns the bearer token, called before every request so a refreshed token is picked up. Must return a non-empty string.AuthOptions.getToken
logger?readonlyLoggerWhere the SDK's warnings go. Defaults to consoleLogger; use silentLogger to silence them.-
onGeometryReuseProbe?readonlyOnGeometryReuseProbeCalled when the first submission that refers to previously uploaded geometry settles whether the API supports that. The event carries the outcome ("supported" or "unsupported") and the ids of the jobs that were accepted.-
surface?readonlyInfraredSurfaceThe application the calls come from. Defaults to "script".AuthOptions.surface
timeout?readonlynumberAlias of timeoutMs, also in milliseconds; timeoutMs wins when both are given.-
timeoutMs?readonlynumberTimeout for each API request, in milliseconds. Default 180 000.-
token?readonlystringA fixed bearer token (JWT), sent in the Authorization header.AuthOptions.token

InfraredClientOptions

Import from @infrared-city/infrared-sdk.

InfraredClientOptions = InfraredClientConfig

Another name for InfraredClientConfig.


InfraredEnvBindings

Import from @infrared-city/infrared-sdk.

Environment values for InfraredClientConfig.env, for runtimes without process.env (for example Cloudflare Workers). Each value that is missing here is read from process.env when that exists.

Properties

PropertyModifierTypeDescription
INFRARED_API_KEY?readonlystringThe API key, used when apiKey is not given.
INFRARED_BASE_URL?readonlystringThe API base URL, used when baseUrl is not given.
INFRARED_GEOMETRY_REF_ENABLED?readonlystringTurns geometry reuse on or off. Accepts 1, true, yes or on for on, and 0, false, no or off for off (any letter case). Unset or empty means on; any other value makes the client constructor throw a TypeError.

InfraredSurface

Import from @infrared-city/infrared-sdk.

InfraredSurface = "platform" \| "webapp" \| "grasshopper" \| "revit" \| "qgis" \| "arcgis" \| "sketchup" \| "archicad" \| "script" \| "cli"

The application an SDK call is made from, sent to the API so usage can be attributed to it.

Defaults to "script" when not set on AuthOptions.


initializeCore

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

initializeCore(options?): Promise<void>

Load and initialise the Infrared core (a WebAssembly module) used by the SDK's local computation.

Wait for it to finish before using operations that run in the core. Once it has succeeded, later calls resolve immediately. This entry point needs one core source (url, bytes or module); the Node entry point can also load the packaged core when none is given.

Parameters

ParameterTypeDescription
optionsInitializeCoreOptionsWhere to load the core from; see InitializeCoreOptions.

Returns

Promise<void>

A promise that resolves when the core is ready.

Throws

If the core cannot be loaded or the options are invalid.

Throws

If the core loaded but failed its version check.


InitializeCoreOptions

Import from @infrared-city/infrared-sdk, @infrared-city/infrared-sdk/tiling.

Options for initializeCore().

Pass at most one of url, bytes and module to choose where the core is loaded from. The Node entry point loads the packaged core when none of them is given.

Properties

PropertyModifierTypeDescription
bytes?readonlyBufferSourceThe bytes of the core WebAssembly file, when you have already loaded them.
module?readonlyModuleAn already compiled core WebAssembly module.
threads?readonlynumberNode only: the number of core threads. Omitted: on Node 22 or later, min(4, cores) (8 from 16 cores) threads with the threaded core that ships in the package (one thread on Node 18 and 20, on one core, or when the pool does not start); 1: the single-threaded core; above 1: that many threads (Node 22 or later). Results are identical for every count; the pool decodes and merges result tiles, zips request bodies and prepares the site. A count cannot be combined with url, bytes or module, and the browser and worker entry points refuse a value above 1. With the threaded core, a core error on any thread is a thrown error. Running out of WebAssembly memory near the 4 GiB limit cannot be caught: it ends the Node process (SIGKILL) after writing one JSON line to stderr.
url?readonlystring \URLURL to fetch the core WebAssembly file from.

JobsServiceOptions

Import from @infrared-city/infrared-sdk.

Settings for constructing a JobsService.

Properties

PropertyModifierTypeDescription
authreadonlyAuthResolverSupplies the authentication headers for each request.
backoffCapSeconds?readonlynumberUpper limit on the delay between status reads while waiting, in seconds.
baseUrlreadonlystring \URLBase URL of the Infrared API.
batchSubmit?readonlybooleanSend the jobs of a binary area run in batch submits (up to 100 jobs in one request) when the API offers them. Each job keeps its own key and its own charge. Default true with apiKey or token; a client with getToken or auth sends one request per job, and so does false.
bigPayloadThresholdBytes?readonlynumberPayload size in bytes above which a submission is uploaded and sent by reference instead of inline. Default 5 MiB.
binaryUrlReuse?readonlybooleanReuse the links of binary content already uploaded instead of uploading it again. Default true.
downloadTimeoutMs?readonlynumberTimeout for downloading a result archive, in milliseconds. Default 600000.
fetch?readonly\{(input, init?): Promise<Response>; (input, init?): Promise<Response>; \}Custom fetch implementation.
gatewayBaseUrl?readonlystring \URLBase URL used for large-payload uploads. Defaults to baseUrl.
geometryReuseEnabled?readonlybooleanReuse geometry already accepted by the service instead of resending it. Default true.
geometryUrlStore?readonlyGeometryUrlStoreKeeps uploaded geometry URLs for a new client. See InfraredClientConfig.geometryUrlStore.
logger?readonlyLoggerWhere the service writes its warnings.
onGeometryReuseProbe?readonlyOnGeometryReuseProbeCalled when the first submission that references previously sent geometry settles, with the outcome (supported or unsupported).
~~pollIntervalMs?~~readonlynumberFixed delay between status reads while waiting, in milliseconds. By default the delay adapts. Deprecated Removed in 2.0. The SDK sets the poll interval.
timeoutMs?readonlynumberTimeout for one API request, in milliseconds. Default 180000.

Logger

Import from @infrared-city/infrared-sdk.

Where the SDK sends its own messages. Pass one to the client to capture or silence them.

Properties

PropertyModifierTypeDescription
debugreadonly(...args) => voidLog a debug message.
errorreadonly(...args) => voidLog an error.
inforeadonly(...args) => voidLog an informational message.
warnreadonly(...args) => voidLog a warning.

OnGeometryReuseProbe

Import from @infrared-city/infrared-sdk.

OnGeometryReuseProbe = (event) => void \| Promise<void>

A callback that receives a GeometryReuseProbeEvent. It may return a promise.

Parameters

ParameterType
eventGeometryReuseProbeEvent

Returns

void \| Promise<void>


ServiceOptions

Import from @infrared-city/infrared-sdk.

Options shared by the SDK's service classes.

Extended by

Properties

PropertyModifierTypeDescription
authreadonlyAuthResolverSupplies the authentication headers for each request.
baseUrlreadonlystring \URLBase URL of the API the service calls.
fetch?readonly\{(input, init?): Promise<Response>; (input, init?): Promise<Response>; \}A fetch implementation to use instead of the global one.
logger?readonlyLoggerWhere the service's own messages, such as warnings, go. InfraredClient passes its logger here, so choosing silentLogger silences the SDK's warnings, and a Node caller can capture them. A service created on its own defaults to consoleLogger.
timeoutMs?readonlynumberTime limit for one request, in milliseconds.

silentLogger

Import from @infrared-city/infrared-sdk.

const silentLogger: Logger

A Logger that discards every message.


VERSION

Import from @infrared-city/infrared-sdk.

const VERSION: "1.1.0" = "1.1.0"

The version of this SDK package, for example "0.14.0".