.github
dev-test
src
website
content
blog
docs
widgets
add-to-your-site.md
architecture.md
azure-backend.md
backends-overview.md
beta-features.md
bitbucket-backend.md
cloudinary.md
collection-types.md
configuration-options.md
contributor-guide.md
custom-widgets.md
customization.md
deploy-preview-links.md
docusaurus.md
examples.md
external-oauth-clients.md
gatsby.md
git-gateway-backend.md
github-backend.md
gitlab-backend.md
gridsome.md
hugo.md
intro.md
jekyll.md
middleman.md
netlify-large-media.md
nextjs.md
nuxt.md
open-authoring.md
releases.md
site-generator-overview.md
start-with-a-template.md
test-backend.md
uploadcare.md
widgets.md
writing-style-guide.md
pages
.keep
data
src
static
.babelrc
.gitignore
.markdownlint.json
.nvmrc
README.md
gatsby-browser.js
gatsby-config.js
gatsby-node.js
package.json
site.yml
yarn.lock
.editorconfig
.eslintignore
.eslintrc.js
.gitattributes
.gitignore
.nvmrc
.prettierignore
.prettierrc
.stylelintrc
.vale.ini
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
babel.config.js
index.d.ts
package.json
renovate.json
setupTestFramework.js
simple-cms-icon.png
simple-cms-logo.png
tsconfig.json
webpack.config.js
yarn.lock
26 lines
3.1 KiB
Markdown
26 lines
3.1 KiB
Markdown
---
|
|
group: Accounts
|
|
weight: 1
|
|
title: Overview
|
|
---
|
|
|
|
A backend is JavaScript code that allows Simple CMS to communicate with a service that stores content - typically a Git host like GitHub or GitLab. It provides functions that Simple CMS can use to do things like read and update files using API's provided by the service.
|
|
|
|
## Backend Configuration
|
|
|
|
Individual backends should 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.
|
|
|
|
| Field | Default | Description |
|
|
| --------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| `repo` | none | **Required** for `github`, `gitlab`, and `bitbucket` backends; ignored by `git-gateway`. Follows the pattern `[org-or-username]/[repo-name]`. |
|
|
| `branch` | `master` | The branch where published content is stored. All CMS commits and PRs are made to this branch. |
|
|
| `api_root` | `https://api.github.com` (GitHub), `https://gitlab.com/api/v4` (GitLab), or `https://api.bitbucket.org/2.0` (Bitbucket) | The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab. |
|
|
| `site_domain` | `location.hostname` (or `cms.netlify.com` when on `localhost`) | 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` | `https://api.netlify.com` (GitHub, Bitbucket) or `https://gitlab.com` (GitLab) | OAuth client hostname (just the base domain, no path). **Required** when using an external OAuth server or self-hosted GitLab. |
|
|
| `auth_endpoint` | `auth` (GitHub, Bitbucket) or `oauth/authorize` (GitLab) | Path to append to `base_url` for authentication requests. Optional. |
|
|
| `cms_label_prefix` | `simple-cms/` | Pull (or Merge) Requests label prefix when using editorial workflow. Optional. |
|
|
|
|
## Creating a New Backend
|
|
|
|
Anyone can write a backend, but we don't yet have a finalized and documented API. If you would like to write your own backend for a service that does not have one currently, we recommend using the [GitHub backend](https://github.com/SimpleCMS/simple-cms/tree/main/src/backends/github) as a reference for API and best practices.
|