Skip to main content

Set up Studio

Setting up Studio connects a Studio project to your stack and adds Studio to your app. This page shows what you'll set up and the order to do it in.

The example on these pages is the Blog project, connected to the Blog stack. Its site runs at http://localhost:3106, and the Blog post template shows the post AI 101 at /blog/ai-101.

Setup happens in two places​

First you create a project in Studio. Then you add Studio to your app's code.

Setup in two steps. Step 1, in Studio: create the Blog project, pick the Blog stack, pick local and English, and set the Canvas URL to /canvas. Step 2, in your app's code: install the Delivery SDK, Live Preview and the Studio SDK, add a route for sections at /canvas, and a route for templates at /blog/{{entry.slug}}, or one catch-all route at /[[...slug]] for every template. The result: Studio opens your site from http://localhost:3106, and you build templates on it.

WhereWhat you doIn the example
In StudioCreate the project, pick its stack, and set its Environment, Language and Canvas URL. You can also turn on Enable Freeform Feature.The Blog project, on the Blog stack, with local, English and /canvas
In your app's codeInstall the Delivery SDK, Live Preview and the Studio SDK. Add a route with <StudioCanvas /> that previews sections, and routes with <StudioComponent /> that show templates. A catch-all route can show every template from one place.<StudioCanvas /> on /canvas, and <StudioComponent /> on /blog/{{entry.slug}}, served by the catch-all route app/[[...slug]]/page.tsx

A few things to know:

  • The Delivery SDK fetches your content. Studio doesn't fetch content on its own.
  • Sections and templates use different components. Sections are previewed through <StudioCanvas />, and templates show through <StudioComponent />. You can't swap one for the other.
  • Studio opens your site from its Base URL. That's the URL your environment has for the project's language, such as http://localhost:3106 for English on local.

The steps, in order​

StepPageWhat you do
1PrerequisitesCheck your stack, your app and your permissions
2Create a projectCreate the Blog project and its Compositions content type
3Configure your projectSet the environment, language and Canvas URL
4CSR or SSRChoose whether your template pages render in the browser or on the server
5Install the Delivery SDKCreate the stack your app fetches content with
6Install Live PreviewAdd Live Preview to that stack and your app
7Install the Studio SDKInstall and set up the Studio SDK
8Mount the section preview routeAdd <StudioCanvas /> on /canvas
9Wire template preview routesAdd <StudioComponent /> on /blog/{{entry.slug}}
10Render on the client or Render on the serverFetch the layout where you chose to in step 4
11Verify your setup end to endCheck your project settings, a section and a template on the canvas, and a deployed template on your site

Keep this order. Three steps need the ones before them:

  • Create the project before you install the Studio SDK. Creating the project creates the content type whose UID the Studio SDK needs. If the SDK names a different content type, Studio shows "Content Types Don't Match" and loads nothing.
  • Install the Delivery SDK before the Studio SDK. The Studio SDK takes the stack the Delivery SDK creates as stackSdk, and reads its Live Preview settings from it.
  • Choose client or server rendering before the installs. The choice decides how your template pages fetch the layout.

Let an AI agent do it​

If you work with an AI agent, the skill pack can do most of this setup for you. Install the Studio skills in your project, then ask your agent in plain words to set up Studio. It uses convert-project-to-studio, which installs the SDKs, adds the canvas route, adds Studio as a fallback route, configures the project and checks it.

You can also ask for one step at a time:

StepSkill
1, Prerequisitesanalyze-project-fit for your app, and enable-visual-experience for your stack's Live Preview
5 to 7, the three installsinstall-studio
9, template preview routessetup-template-preview-routes
11, verifyverify-setup

The skills don't create your stack, tokens or environment. Do that in Contentstack first. See Set up Studio with skills and What are skills?

Try Studio without an app first​

If the project has no Base URL, Studio shows its Playground canvas instead of your site. The Playground canvas doesn't need your app or the Studio SDK, so you can try Studio before you write any code. On the Playground canvas, Deploy is turned off. See Try Studio without an app.

Before you start​

Report a problem with this page