Skip to Content
🎉 New release with new features and improvements! V0.0.6 Release →

Configuration

The BshEngine constructor accepts the following options:

interface BshEngineOptions { host?: string; apiKey?: string; jwtToken?: string; refreshToken?: string; clientFn?: BshClientFn; authFn?: BshAuthFn; refreshTokenFn?: BshRefreshTokenFn; onTokenRefreshed?: BshOnTokenRefreshedFn; tenantFn?: BshTenantFn; preInterceptors?: BshPreInterceptor[]; postInterceptors?: BshPostInterceptor[]; errorInterceptors?: BshErrorInterceptor[]; } const bshEngine = new BshEngine(options);
OptionDescriptionReference
hostThe URL of the BSH Engine instance
apiKeyThe API key for authenticationAPI Key Authentication
jwtTokenThe JWT access tokenJWT Authentication
refreshTokenThe refresh token for JWT renewalAuto Refresh
clientFnThe custom HTTP client functionCustom HTTP Client
authFnThe custom authentication functionCustom Authentication
refreshTokenFnThe custom refresh token functionAuto Refresh
onTokenRefreshedOptional callback invoked with the new access token when the engine silently refreshes JWT during a request; use it to persist the token for your next authFn or jwtToken readAuto Refresh
tenantFnOptional async function that returns the active tenant id; when non-empty, the SDK sends X-Tenant-Id on every request (common for admin users operating in a selected tenant)Tenants Service
preInterceptorsThe request interceptorsPre-Interceptors
postInterceptorsThe response interceptorsPost-Interceptors
errorInterceptorsThe error interceptorsError Interceptors