@the-smithy/create-hearth-site
v0.19.0
Published
Start a new client website powered by Hearth: pnpm create @the-smithy/hearth-site
Readme
@the-smithy/create-hearth-site
Starts a new website powered by Hearth, The Smithy's headless CMS: a Next.js site with every content block rendered, SEO, forms, live preview and the publish webhook, ready to restyle.
It needs API access to Hearth. The site reads all of its content from a Hearth site with that site's API key, so it shows nothing without a Hearth account. Developer access is by invitation: request it at hearth.thesmithy.io/developers.
Before you start
- Node 20.9 or later, and pnpm (run
corepack enableonce ifpnpmisn't found). - The site's address in Hearth: open the site in Hearth and copy the part after
/admin/sites/in the address bar. Forhearth.thesmithy.io/admin/sites/acme/pagesit'sacme.
Create the site
From the folder where you keep your projects, run:
pnpm create @the-smithy/hearth-site@latest acme-website --site acmeReplace acme-website with the folder to create and acme with your site's address. Each part:
| Part | What it is |
| --- | --- |
| pnpm create @the-smithy/hearth-site@latest | Runs this package. pnpm create @the-smithy/hearth-site is pnpm's short form of @the-smithy/create-hearth-site. Keep @latest: without it, pnpm skips releases less than a day old and quietly uses an older one |
| acme-website | The folder to create, which also names the project. It must not exist yet, or must be empty |
| --site acme | Your site's address in Hearth (lowercase letters, numbers and dashes). Written to .env.local as HEARTH_SITE |
Leave out the folder or --site and you're asked for them. Add --skip-install to skip pnpm install.
The command copies the starter into the new folder, writes .env.local with the site's address, runs
git init and installs the packages. Then:
cd acme-websiteAdd an API key to .env.local (Hearth → the site → API & webhooks → API keys), and run pnpm dev. The
new site's README walks through the first run, previews, deploying and troubleshooting.
Documentation
Once you have developer access, the full documentation is in your Hearth account under API docs.
License
For use with Hearth. See LICENSE.
