ApiClientConfig interface
Interface for API Client configuration. Includes an optional function to retrieve the access token dynamically.
Properties
| base |
Base URL of the Rayfin backend the client targets. Use an absolute URL
(for example, the deployed Fabric item URL) to call a backend directly, or
an empty string ( |
| fetch | Fetch implementation to use, for example one configured with a network proxy. |
| functions |
Optional override for the functions invocation host. When set, function
invocations ( |
| get |
Returns or resolves the current bearer token, or |
| headers | Default headers merged into every request. |
| moniker | Explicit |
| on |
Callback when retry after refresh also returns 401. |
| on |
Invoked when a |
| publishable |
Publishable key used for service-level authentication. Required. |
| timeout | Default request timeout in milliseconds (defaults to 30000). |
| use |
Property Details
baseUrl
Base URL of the Rayfin backend the client targets. Use an absolute URL
(for example, the deployed Fabric item URL) to call a backend directly, or
an empty string ('') to keep requests same-origin so a dev-server proxy
can forward them.
baseUrl: string
Property Value
string
fetch
Fetch implementation to use, for example one configured with a network proxy.
fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>
Property Value
(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>
functionsBaseUrl
Optional override for the functions invocation host. When set, function
invocations (client.functions.<name>.invoke(...)) are routed to
${functionsBaseUrl}/api/<name> (Azure Functions Core Tools convention)
instead of the default ${baseUrl}/functions/<name>/invoke path that
goes through the Fabric InvokeController. Set this in local-debug
scenarios (e.g. from import.meta.env.VITE_RAYFIN_FUNCTIONS_URL) to
point the frontend at a locally-running func start process while
data calls continue to hit the deployed Fabric item via baseUrl.
functionsBaseUrl?: string
Property Value
string
getAccessToken
Returns or resolves the current bearer token, or null.
getAccessToken?: () => string | Promise<string | null> | null
Property Value
() => string | Promise<string | null> | null
headers
Default headers merged into every request.
headers?: Record<string, string>
Property Value
Record<string, string>
moniker
Explicit x-ms-workload-resource-moniker value (typically a resolved
Fabric item ID). Takes precedence over the GUID heuristically extracted
from baseUrl, so callers with an authoritative resolved item ID (e.g.
resolveRayfinConfig()'s resolved runtimeConfig.itemId) aren't at
the mercy of URL-shape guessing.
moniker?: string
Property Value
string
onAuthExhausted
Callback when retry after refresh also returns 401.
onAuthExhausted?: () => void
Property Value
() => void
onRefreshNeeded
Invoked when a 401 response indicates the access token must be refreshed.
onRefreshNeeded?: () => Promise<void>
Property Value
() => Promise<void>
publishableKey
Publishable key used for service-level authentication. Required.
publishableKey: string
Property Value
string
timeout
Default request timeout in milliseconds (defaults to 30000).
timeout?: number
Property Value
number
useProxy
Warning
This API is now deprecated.
This option no longer has any effect and will be removed in a
future major release. The client no longer inspects the runtime environment
to rewrite URLs. To route requests through a development proxy, set
baseUrl to an empty string ('') so requests stay same-origin, and
configure your dev server proxy accordingly. To call a backend directly,
pass its absolute URL as baseUrl.
useProxy?: boolean
Property Value
boolean