@causalfoundry/js-sdk
Version:
Causal Foundry WEB SDK (JS/TS)
30 lines (20 loc) • 1.15 kB
Markdown
After executing `npm run build`, several targets will be created:
| File | Environment | How to load | Use dynamic loader |
|---------------|--------------|-----------------|------------------- |
| lib.js | web | package manager | No |
| init.js | web | cdn | No |
| lib.loader.js | web | package manager | Yes |
| lib.node.js | nodejs | package manager | No |
To deploy the library in third party apps, the preferred mechanism is to use `lib.loader.js`. It provides a thin layer that exposes the public javascript API to the application and, internally, it tries to download the latest version of the library (`init.js`) compatible at patch level (according to semantic versioning definition). In case it fails, is will use the fallback version, `lib.js`, which is packaged together.
CDN url may be customized at configuration level:
```
options = {
...
cdnUrl=<cdn url>
...
}
new CfLog(<key, options>)
```
By default, it is `https://cdn.causalfoundry.ai`
[](./Readme.md)