Package Exports
- justwords-node
- justwords-node/lib/main/index.js
- justwords-node/lib/module/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (justwords-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Just Words Node SDK
Typescript library for Just Words (YC W24).
Get Started
Installation
npm install justwords-node
Initialize
import {JustWords} from "justwords-node";
// Initialize client
await JustWords.initialize({apiKey, orgId});
// Get copy variant for a template
const copy = JustWords.getCopy("<template-id>");
// Get copy variant for a template, filtered by language (depends on how the metrics are set up)
const copyJa = JustWords.getCopy("<template-id>", { criteria: { language: "ja" } });
// Print copy ID
console.log(copy.id); // "<copy-id>"
// Print copy variable
console.log(copy.vars.text); // "just setting up my copy"
Tips:
- The
initialize
function must be awaited before callingJustWords.getCopy
.JustWords.getCopy
will throw if it has not been initialized first. JustWords.getCopy
will throw if the template ID is not known. A template must be created in advance before fetching any copy variants.
Changelog
1.1.2 (2024-06-11)
- Updated prefetchData to return the data directly and updated the types to be used in other libraries
- Removed 'stats' param from 'Copy' definition. Should be unused.
1.1.0 (2024-05-31)
- Rewrote the pipeline to be more modular
- Added "epsilon sampling" so that some percentage of copy are randomly shown
1.0.11 (2024-05-02)
- Added jitter to the polling function and increased default polling period from 1 min to 10 min.
1.0.10 (2024-04-30)
- Removed lingering console.log
1.0.9 (2024-04-30)
- Can set host as an initialization param. Preparing for on-prem use-cases.
1.0.8
- New changelog!
1.0.7 (2024-04-17)
- Fixed issue where API key was being passed as an Authorization header and not as an 'X-Api-Key' header.