Files
.github
core
node_modules
website
content
docs
add-to-your-site-bundling.mdx
add-to-your-site-cdn.mdx
add-to-your-site.mdx
additional-links.mdx
backends-overview.mdx
beta-features.mdx
bitbucket-backend.mdx
cloudinary.mdx
collection-overview.mdx
collection-types.mdx
configuration-options.mdx
contributor-guide.mdx
custom-icons.mdx
custom-previews.mdx
custom-widgets.mdx
customization-overview.mdx
docusaurus.mdx
examples.mdx
gatsby.mdx
git-gateway-backend.mdx
github-backend.mdx
gitlab-backend.mdx
gridsome.mdx
hugo.mdx
intro.mdx
jekyll.mdx
local-backend.mdx
middleman.mdx
netlify-cms-migration-guide.mdx
netlify-large-media.mdx
nextjs.mdx
nuxt.mdx
site-generator-overview.mdx
start-with-a-template.mdx
test-backend.mdx
typescript.mdx
updating-your-cms.mdx
uploadcare.mdx
widget-boolean.mdx
widget-code.mdx
widget-color.mdx
widget-datetime.mdx
widget-file.mdx
widget-hidden.mdx
widget-image.mdx
widget-list.mdx
widget-map.mdx
widget-markdown.mdx
widget-number.mdx
widget-object.mdx
widget-relation.mdx
widget-select.mdx
widget-string.mdx
widget-text.mdx
widgets.mdx
writing-style-guide.mdx
community.json
config.json
homepage.json
menu.json
releases.json
design
public
src
.editorconfig
.eslintignore
.eslintrc.js
.eslintrc.json
.gitignore
.prettierignore
.prettierrc
netlify.toml
next.config.js
package.json
tsconfig.json
yarn.lock
.gitattributes
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
renovate.json
static-cms-icon.png
static-cms-logo.png
static-cms/website/content/docs/backends-overview.mdx

26 lines
4.8 KiB
Plaintext
Raw Normal View History

2022-09-30 11:39:35 -04:00
---
2022-11-04 17:41:12 -04:00
group: Backends
2022-09-30 11:39:35 -04:00
title: Overview
weight: 1
2022-09-30 11:39:35 -04:00
---
2022-10-02 20:06:20 -04:00
A backend is JavaScript code that allows Static CMS to communicate with a service that stores content - typically a Git host like GitHub or GitLab. It provides functions that Static CMS can use to do things like read and update files using API's provided by the service.
2022-09-30 11:39:35 -04:00
## Backend Configuration
2022-11-04 17:41:12 -04:00
Individual backends provide their own configuration documentation, but there are some configuration options that are common to multiple backends. A full reference is below. Note that these are properties of the `backend` field, and should be nested under that field.
2022-09-30 11:39:35 -04:00
2022-11-04 17:41:12 -04:00
| Name | Type | Default | Description |
| ------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name | 'git-gateway'<br />\| 'github'<br />\| 'gitlab'<br />\| 'bitbucket'<br />\| 'test-repo'<br />\| 'proxy' | | The backend git provider |
| repo | string | | Required for `github`, `gitlab`, and `bitbucket` backends. Ignored by `git-gateway`. Follows the pattern `[org-or-username]/[repo-name]` |
| branch | string | `main` | _Optional_. The branch where published content is stored. All CMS commits and PRs are made to this branch |
| api_root | string | GitHub<br />`https://api.github.com`<br /><br />GitLab<br/>`https://gitlab.com/api/v4`<br /><br />Bitbucket<br />`https://api.bitbucket.org/2.0` | _Optional_. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab |
| site_domain | string | `location.hostname`<br /><br />On `localhost`<br />`cms.netlify.com` | _Optional_. Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly |
| base_url | string | GitHub or Bitbucket<br />`https://api.netlify.com`<br /><br />GitLab<br />`https://gitlab.com` | _Optional_. OAuth client hostname (just the base domain, no path). **Required** when using an external OAuth server or self-hosted GitLab |
| auth_endpoint | string | GitHub or Bitbucket<br />`auth`<br /><br />GitLab<br />`oauth/authorize` | _Optional_. Path to append to `base_url` for authentication requests. |
2022-09-30 11:39:35 -04:00
## Creating a New Backend
2022-11-04 17:41:12 -04:00
Anyone can write a backend, but the API is not yet finalized and documented. If you would like to write your own backend for a service that does not have one currently, Static CMS recommends using the [GitHub backend](https://github.com/StaticJsCMS/static-cms/tree/main/core/src/backends/github) as a reference for API and best practices.