@indiekit/store-github
GitHub content store adaptor for Indiekit.
Installation
npm install @indiekit/store-github
Requirements
A GitHub personal access token with read and write permissions to a repository.
If creating a fine-grained personal access token, ensure that permissions for your repository include Read access to Metadata and Read and write access to Contents. The token expiration is up to you.
IMPORTANT
Store your personal access token in an environment variable called GITHUB_TOKEN
so that only you and the application can see it.
Usage
Add @indiekit/store-github
to your list of plug-ins, specifying options as required:
json
{
"plugins": ["@indiekit/store-github"],
"@indiekit/store-github": {
"user": "username",
"repo": "reponame"
}
}
Options
Option | Type | Description |
---|---|---|
baseUrl | string | Enterprise GitHub API URL. Optional, defaults to https://api.github.com . |
user | string | Your GitHub username. Required. |
repo | string | The name of your GitHub repository. Required. |
branch | string | The branch files will be saved to. Optional, defaults to main . |
token | string | A GitHub personal access token. Required, defaults to process.env.GITHUB_TOKEN . |