Adopt your existing copy
Your components are already full of copy — headlines, button labels, empty-state text — written as string literals. stet moves those strings behind keys without you retyping anything. stet scan finds them, stet register rewrites them, and every adopted value lands in your committed fallback in the same commit.
You need a project with stet installed — the quickstart gets you there. Everything on this page works snapshot-only; the last step needs a store.
01Scan your components
scan reads your components and lists the string literals that are really copy — sentences a visitor sees, not class names or config values. Each finding shows the file, the line and the key name it would get. Nothing is changed.
The net is wider than components: plain .ts copy modules you declare in stet.config.json are walked in full, and template files like .astro are flagged as possible copy. In an .astro template you place the read yourself: declare the key in content/descriptor.json, give it a value in defaults.json, and read it with copy('key'). A site that's only HTML files follows the plain HTML chapter.
$ npx stet scan
scan: 2 files, 3 unkeyed literals
warn: src/pages/index.tsx:4:11 unkeyed copy "Never miss a post again." — propose key never_miss_a_post_again
warn: src/pages/index.tsx:5:10 unkeyed copy "Track every mention of your brand across the feeds you ca..." — propose key track_every_mention_of_your_brand
warn: src/pages/index.tsx:6:25 unkeyed copy "Start free" — propose key start_free02Adopt them
register turns each literal into a key read and shows you every diff as it goes. The rewrite touches only the leaf — callers, props and markup stay exactly as they are. Anything that shouldn't be copy, you leave out.
Run it first without --write to review every diff; nothing is written. Then run it with --write. The adopted values land in defaults.json in the same commit, so the words that were in your components are now in your committed fallback — same text, same rendering, now editable.
$ npx stet register --from scan
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -1,9 +1,11 @@
-export default function Home() {
+import { useCopy } from '@getstet/stet/react';
+export default function Home() {const copy = useCopy();
return (
<main>
- <h1>Never miss a post again.</h1>
+ <h1>{copy('never_miss_a_post_again')}</h1>
⋮
$ npx stet register --from scan --write
src/pages/index.tsx: rewrote 9 edits
wrote content/descriptor.json, content/defaults.json and the codegen modules: 3 keys added
register: applied03Seed the store
With a database, seed writes the snapshot in as version 1, once per key — the point where your copy history starts. Snapshot-only projects skip this; the committed file already is the live value.
$ npx stet seed04Check the result
audit compares the descriptor against the store and reports what's registered but not yet editable, and what's in the store but no longer in your code. It reports and never deletes.
$ npx stet auditNext
- Quickstart — install, first key, first publish
- Dashboard — change the words in your browser and commit
- Versioning — every change kept, undo in one click