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 ( |
| functions |
Optional override for the functions invocation host. When set, function
invocations ( |
| get |
Returns the current access token to attach as a bearer token, or |
| headers | Default headers merged into every request. |
| 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
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 the current access token to attach as a bearer token, or null.
getAccessToken?: () => null | string
Property Value
() => null | string
headers
Default headers merged into every request.
headers?: Record<string, string>
Property Value
Record<string, 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