Skip to content

Get the website code

Pick a starter, get its code on GitHub with this space's settings filled in, deploy it to Vercel or Netlify, connect the preview and check that the website is connected.

How-to guide5 min read

A template gives a space its content: content types, components and sample pages. A starter is the code of a website or app that shows that content. Configuration › Website code brings the two together: it picks the right starter for the space, fills in the settings and checks the result, so nobody copies keys and addresses across by hand.

A new space opens on this page as soon as the wizard has created it. Choose Open the space to come back later. Every plan has it.

Who can do what

See the page and copy the settings
Who
Developer, Administrator or Owner
Create keys on the page
Who
Anyone who can create API keys: Developer, Administrator or Owner
Save the Preview URL
Who
Administrator or Owner, as in Settings
Check the connection
Who
Anyone who can see the page

1Choose a starter

The page recommends the website starter for a space made from a template. It is a finished Next.js website that draws every component the templates use, so the sample Northwilds pages look right from the first deploy. For a space started from scratch it recommends the Next.js starter.

The other starters are the finished code of each quickstart: React, Astro, Nuxt, Vue, SvelteKit, Angular, Laravel, Symfony, and apps for Apple platforms and Android. They draw only their own example components, so a template's pages show their blocks once you add components for them.

2Add the settings

Choose the environment the website reads, and the region. Start with Staging, so editors can preview drafts on it. The page lists every setting the starter reads, under the starter's own names, such as CMS_API_URL for Next.js or NUXT_CMS_API_URL for Nuxt:

  • API address and region: filled in, with a button to copy each.
  • Public key (cms_pk_): choose Create a public key. It reads published content only.
  • Preview key (cms_sk_): choose Create a preview key, for Staging only. It reads drafts, so it stays on the website's server and never goes into the browser, an app or a link. The live website never gets one.
  • Webhook secret: after the first deploy, create a webhook to the route the page names, such as /api/revalidate, and paste its secret. See Refresh the website when content changes.

A key is shown once. The page also writes the whole settings file, such as .env.local, with the keys you created, ready to copy. Never commit it. If the environment already has keys you still have, use those instead.

3Get the code

  • Use this template on GitHub opens GitHub's form for a new repository made from the starter.
  • Deploy with Vercel is there for the website starter, Next.js and Nuxt, and Deploy to Netlify for Nuxt. Each copies the starter to your GitHub and deploys it.

The deploy buttons fill in the API address and region. They ask for the public key, which you paste from step 2: keys never go in a link, because links end up in browser history and logs. Add the preview key in the project's settings afterwards. For the other starters, deploy them as any other project of their framework; see Deploy your website.

4Connect the preview

Paste the staging website's address, such as https://stage.northwilds.com, and choose Save. It is the same Preview URL as in the space's settings, so editors now see the real website beside each page. Developers who can't save it send the address to an Administrator or Owner.

Apps have no Preview URL: their drafts go through a server of your own, as the Apple and Android quickstarts show.

5Check the connection

Choose Check the website. CMS Orbit opens a page of the Preview URL with a preview link that works for 2 minutes, the way the editor does, and reports:

The website answers
What it means
The address is public, uses https and answers without an error.
The website checked the preview link
What it means
The website asked CMS Orbit whether the preview link is valid, so drafts show in the editor. If it didn't, the preview key or the preview route is missing, or the website's API address points elsewhere.
The editor may show the website
What it means
The website doesn't refuse to be framed. If it does, remove X-Frame-Options and allow the editor in frame-ancestors on the staging website, as in Deploy your website.
A key last read content
What it means
When a key of the environment last read content, which shows that the website reads published pages.

The check needs a page in the environment to preview. Template spaces have sample pages in Staging; in a space started from scratch, add a TEMP page first and delete it afterwards.

When the live website is ready

Do the same for Production on this page: create a public key there and add it to the live website's settings. The live website gets no preview key, and its address goes in Configuration › Domains, not the Preview URL. See Deploy your website for the go-live checklist.

Deploy after publishing

If the website is built ahead of time on Vercel or Netlify, Deploy after publishing at the bottom of this page starts a deploy after content is published, for each environment you choose. Vercel or Netlify is connected once in Orbit, under Connections. The page shows when the last deploy started and, with a token for reading deploys, how it went. See Deploy your website after publishing.

Was this page helpful?

Read next