# justwords-node

> just words Node SDK for server-side copy optimization.

Latest version **1.1.3** (published 2024-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install justwords-node
pnpm add justwords-node
yarn add justwords-node
bun add justwords-node
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2024-06-11 |
| First published | 2024-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 135.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | justwordsai |
| Maintainers | justwords-ai |
| Keywords | typescript, ycombinator, ycw24, justwords, just words, copy optimization, ai |

## Links

- npm: https://www.npmjs.com/package/justwords-node
- Repository: https://github.com/justwordsai/node-sdk
- Homepage: https://github.com/justwordsai/node-sdk#readme
- Issues: https://github.com/justwordsai/node-sdk/issues
- npm.io page: https://npm.io/package/justwords-node

## Dependencies (4)

- [node-fetch](https://npm.io/package/node-fetch.md) ^3.3.2
- [@stdlib/types](https://npm.io/package/@stdlib/types.md) ^0.3.2
- [@stdlib/random-base-beta](https://npm.io/package/@stdlib/random-base-beta.md) ^0.2.1
- [@stdlib/random-base-uniform](https://npm.io/package/@stdlib/random-base-uniform.md) ^0.2.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2024-06-11
- 1.1.2 — 2024-06-11
- 1.1.1 — 2024-06-11
- 1.1.0 — 2024-05-31
- 1.0.11 — 2024-05-02
- 1.0.10 — 2024-04-30
- 1.0.9 — 2024-04-30
- 1.0.8 — 2024-04-22
- 1.0.7 — 2024-04-17
- 1.0.6 — 2024-04-03
- 1.0.4 — 2024-04-02
- 1.0.3 — 2024-03-18
- 1.0.2 — 2024-03-17
- 1.0.1 — 2024-03-17
- 1.0.0 — 2024-03-17

## README

# Just Words Node SDK

Typescript library for Just Words (YC W24).

## Get Started

### Installation

```bash
npm install justwords-node
```

### Initialize

```javascript
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 calling `JustWords.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.

---
_Source: https://npm.io/package/justwords-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
