@premai/api-sdk 1.0.42 → 1.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1023,3 +1023,22 @@ import type {
1023
1023
  PaginationInfo,
1024
1024
  } from "@premai/api-sdk";
1025
1025
  ```
1026
+
1027
+ ## BareKit (mobile)
1028
+
1029
+ When running this SDK inside a [react-native-bare-kit](https://github.com/holepunchto/react-native-bare-kit) worklet, pass an `assets` directory to `new Worklet(...)`. bare-kit extracts bundled assets to that directory at startup and rewrites resolutions to real `file://` URLs — this lets WASM to load directly from disk on the fast path:
1030
+
1031
+ ```js
1032
+ import { Worklet } from 'react-native-bare-kit';
1033
+ import * as FileSystem from 'expo-file-system'
1034
+
1035
+ const cacheDir = new FileSystem.Directory(FileSystem.Paths.cache, 'reticle-assets')
1036
+ if (!cacheDir.exists) cacheDir.create()
1037
+
1038
+ const worklet = new Worklet({
1039
+ assets: cacheDir.uri.replace(/^file:\/\//, ''),
1040
+ });
1041
+ await worklet.start('/worklet.bundle', source);
1042
+ ```
1043
+
1044
+ If `assets` is omitted, the SDK falls back to an inline base64 copy of the WASM bytes shipped inside the module.