@oneplatform/app-sdk
@oneplatform/app-sdk¶
@oneplatform/app-sdk — React hooks and context for OnePlatform hosted apps.
Quick start¶
import { AppProvider, useQuery, useMutation } from '@oneplatform/app-sdk';
function Root() {
return (
<AppProvider>
<ProductList />
</AppProvider>
);
}
function ProductList() {
const { data, isLoading } = useQuery('Product');
if (isLoading) return <div>Loading...</div>;
return <ul>{data?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;
}
Only the seven public exports and their associated types are re-exported here. Internal modules (client/, cache/, ws/) are not accessible from package consumers. Any attempt to import @oneplatform/app-sdk/client/BffClient will fail at the esbuild enforcement layer in the sandbox build.
Interfaces¶
- AppSDKError
- BulkResult
- EntityEvent
- MutationResult
- Pagination
- QueryOptions
- QueryResult
- SubscriptionOptions
- SubscriptionResult
- UserContext