- Build
- References
Configuration
Primary Netlify Create configuration file reference (stackbit.config.js) that enables you to customize the visual editing experience for your site.
stackbitVersion
property.
stackbit.config.js
(or stackbit.config.ts
) is a configuration file placed in the root of your project that enables you to customize the visual editing experience with Netlify Create for your project. Note that this file is not required for your project to run in production.
Examples
Here are a few examples of common configuration patterns in Netlify Create sites.
Typical Configuration
Here is a simple example that uses a supported framework (Next.js) and a remote content source (Contentful):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
In this example, there is a content type (model) in Contentful with an ID of page
that serves as the primary page model for the site, using a field called slug
to build the URL path for each page.
Minimal Configuration
Your site must have a Netlify Create configuration file to run in Netlify Create, whether locally or in our web application. However, you can still run your project in Netlify Create with a minimal amount of configuration. See below.
1
2
3
4
This is enough to get your project running with Netlify Create. However, Netlify Create will not know where your content lives. After you're up and running, you'll want to configure your content source.
Using TypeScript
To use TypeScript to add type checking and autocompletion to your configuration, rename stackbit.config.js
to stackbit.config.ts
.
Netlify Create types are exported from @stackbit/types
and can be used by exporting the defineStackbitConfig
function from your configuration file. See below for an example.
TypeScript Example
Here is the typical configuration example from above, written in TypeScript:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Useful Types
The following types are likely to be most useful when configuring your project:
RawConfig
: The main configuration object.YamlDataModel
: For a model in themodels
property using typedata
.YamlObjectModel
: For a model in themodels
property using typeobject
.YamlPageModel
: For a model in themodels
property using typepage
.
Configuration Properties
Below you will find the base configuration properties, as well as links to sections with more detailed configuration references.
stackbitVersion
The version of the Netlify Create configuration and visual editing capabilities your project is using.
1
2
3
4
- Versions prior to 0.4.0 are deprecated.
List of Properties
All other properties are currently separated into individual topic pages with additional details.
actions
assets
(deprecated)cmsName
(deprecated)contentSources
customContentReload
dataDir
(deprecated)devCommand
duplicatableModels
excludePages
(deprecated)experimental
import
installCommand
mapDocuments
(experimental)mapModels
modelExtensions
models
(deprecated)modelsSource
(deprecated)nodeVersion
nonDuplicatableModels
objectTypeKey
(deprecated)pageLayoutKey
(deprecated)pagesDir
(deprecated)postGitCloneCommand
postInstallCommand
preInstallCommand
presetReferenceBehavior
(alias:referenceBehavior
)presetSource
referenceBehavior
(alias:presetReferenceBehavior
)sidebarButtons
siteMap
ssgName
styleObjectModelName
viewports