GravityRailConfig
@gravity-rail/react / GravityRailConfig
Interface: GravityRailConfig
@gravity-rail/react — canonical React components & hooks for embedding Gravity Rail (chat, forms, voice) into any site: built-in source sites or third-party hosts. Transport is pluggable via GravityRailProvider; the default is same-origin, which works in a sandboxed source-site bundle with zero config.
Properties
apiUrl?
optionalapiUrl:string
Absolute API origin for cross-origin realtime transports (voice / operator
WebSocket). Defaults to the injected site context's apiUrl.
baseUrl?
optionalbaseUrl:string
API base URL. Default "" means same-origin (the Gravity Rail origin proxy or the host's own BFF). Set to an absolute origin only when calling a different origin directly (rare — prefer a same-origin proxy).
fetch()?
optionalfetch: (input,init?) =>Promise<Response>
Custom fetch implementation. Use this on a third-party host to attach an
Authorization header, rewrite paths to your BFF, etc. Defaults to the
global fetch with same-origin credentials.
Parameters
input
RequestInfo | URL
init?
RequestInit
Returns
Promise<Response>
getAccessToken()?
optionalgetAccessToken: () =>Promise<string>
Returns a short-lived access token for realtime WebSocket transports. On a source site this should hit a same-origin endpoint that mints the token from the site session; on a third-party host it returns your OAuth token.
Returns
Promise<string>
siteContext?
optionalsiteContext:SiteContext
Explicit site context. Defaults to window.GRAVITY_RAIL_SITE_CONTEXT.
workspaceUuid?
optionalworkspaceUuid:string
Workspace UUID. Defaults to the injected site context's workspaceUuid.