Changelog
1.9.0
Layered JavaScript API
The npm packages now expose one abstraction layer each:
@solibo/solibo-sdkowns the JavaScript client, generated models, authentication, event bus, and raw Kotlin interop.@solibo/solibo-queryowns framework-independent TanStack Query option factories, query keys, pagination helpers, and mutation definitions.@solibo/solibo-reactownsSoliboProvider,useSdk(), and React hooks.
SoliboClient is the JavaScript-native SDK surface. Its generated API methods take one named-parameter object and return the decoded response body. The unchanged Kotlin-generated client is available through client.raw and the @solibo/solibo-sdk/interop entry point when response status, headers, redirects, downloads, or another low-level capability is required.
import { createSoliboClient } from '@solibo/solibo-sdk'
const client = createSoliboClient({
baseUrl: 'https://api.home.solibo.no',
auth: {
kind: 'browser',
userPoolId: '...',
clientId: '...',
},
})
const company = await client.api.companies.showCompany({ companyId: '42' })
// Explicit escape hatch: positional parameters and HttpResponse<T>.
const response = await client.raw.api.companies.showCompany(42n)
JavaScript migration list
| Before | Now |
|---|---|
sdk.api.companies.showCompany(42n).then(r => r.body()) | client.api.companies.showCompany({ companyId: 42 }) |
Pass a raw SoliboSDK to a query factory | Pass fromRawSdk(rawSdk), or the client returned by createSoliboClient(...) |
Import SDK models from @solibo/solibo-query or @solibo/solibo-react | Import them from @solibo/solibo-sdk |
Import query factories or keys from @solibo/solibo-react | Import them from @solibo/solibo-query |
| Import hooks from a lower package | Import hooks from @solibo/solibo-react |
| Use a facade call when status or headers matter | Use client.raw, which preserves HttpResponse<T> and request-header controls |
Import low-level Kotlin bridge or upload helpers from @solibo/solibo-query | Use the SDK facade/raw DocumentsApi, or a query mutation factory for the complete flow |
Import toIntegratedDocumentInput or prepareIntegratedDocumentSources from @solibo/solibo-query | Pass document sources to a *WithDocumentsMutationOptions factory, or use client.raw.api.integratedDocuments for the low-level composite API |
The root @solibo/solibo-sdk entry point retains its previous raw KMP exports, so existing direct SDK imports and positional calls continue to compile. The explicit client.raw property makes the low-level boundary visible in new code.