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.
Backend Configuration
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.
Name 17348_47a176-14> |
Type 17348_1e54cd-fb> |
Default 17348_f4bd48-22> |
Description 17348_446f3d-b1> |
---|---|---|---|
name 17348_b9dbec-71> |
‘git-gateway’ | 17348_9cc3f9-3b> |
The backend git provider 17348_53cce8-71> |
repo 17348_07c69b-90> |
string 17348_511cdd-89> | 17348_53a2f5-f3> |
Required for |
branch 17348_2fbeef-bd> |
string 17348_1e7853-62> |
|
Optional. The branch where published content is stored. All CMS commits and PRs are made to this branch 17348_5e2156-ab> |
api_root 17348_7d631f-5e> |
string 17348_860fec-a5> |
GitHub |
Optional. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab 17348_1ecb3d-a1> |
site_domain 17348_fae1cc-12> |
string 17348_0bdbb8-55> |
|
Optional. Sets the |
base_url 17348_7a4b44-ac> |
string 17348_dc5d41-e5> |
GitHub or Bitbucket |
Optional. OAuth client hostname (just the base domain, no path). Required when using an external OAuth server or self-hosted GitLab/Gitea 17348_45ccf6-bf> |
auth_endpoint 17348_4945ef-5d> |
string 17348_fc679d-4e> |
GitHub or Bitbucket |
Optional. Path to append to |
cms_label_prefix 17348_ac9b87-94> |
string 17348_bcf461-24> |
|
Pull (or Merge) Requests label prefix when using editorial workflow. Optional. 17348_ed2531-24> |
Creating a New Backend
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 as a reference for API and best practices.