1.0.10 • Published 3 days ago
justwords-node v1.0.10
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.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.