{"id":27384225,"url":"https://github.com/nuzulul/decap-cms-google-apps-script","last_synced_at":"2026-04-19T07:35:29.613Z","repository":{"id":286730290,"uuid":"962060468","full_name":"nuzulul/decap-cms-google-apps-script","owner":"nuzulul","description":"decap cms github oauth client implementation in google apps script","archived":false,"fork":false,"pushed_at":"2025-04-13T13:48:20.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T16:45:47.856Z","etag":null,"topics":["decap-cms","headless-cms","jamstack","netlify-cms","static-site"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuzulul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-07T15:31:12.000Z","updated_at":"2025-04-13T13:48:24.000Z","dependencies_parsed_at":"2025-04-13T16:33:26.840Z","dependency_job_id":"365f0aa9-04d8-40fb-a101-501e7e6a39ba","html_url":"https://github.com/nuzulul/decap-cms-google-apps-script","commit_stats":null,"previous_names":["nuzulul/decap-cms-google-apps-script"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nuzulul/decap-cms-google-apps-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuzulul%2Fdecap-cms-google-apps-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuzulul%2Fdecap-cms-google-apps-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuzulul%2Fdecap-cms-google-apps-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuzulul%2Fdecap-cms-google-apps-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuzulul","download_url":"https://codeload.github.com/nuzulul/decap-cms-google-apps-script/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuzulul%2Fdecap-cms-google-apps-script/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31999169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decap-cms","headless-cms","jamstack","netlify-cms","static-site"],"created_at":"2025-04-13T16:24:23.250Z","updated_at":"2026-04-19T07:35:29.595Z","avatar_url":"https://github.com/nuzulul.png","language":"JavaScript","funding_links":[],"categories":["OAuth Client"],"sub_categories":[],"readme":"# decap-cms-google-apps-script\nA [Decap CMS](https://decapcms.org/) (formerly Netlify CMS) Github OAuth Client implementation in Google Apps Script acting as the External OAuth Client allowing Decap CMS without using Netlify's service.\n\nUnfortunately Google Apps Script uses double iframes for web type projects which cause a problem with the built-in Github backend authorization code flow. \n\nWhile the built-in Github backend doesn't support authorization code flow with PKCE (Proof Key for Code Exchange) so we will create custom OAuth2 PKCE client as middleware to make Github backend work with Google Apps Script project.\n\n## Installation\n\n### 1. Create Google Apps Script project\n\n- Go to [https://script.google.com/](https://script.google.com/) and then create `New Project`\n- Click `Untitled project` then give your project a name `decap` or anything you like and click `Rename` \n- Replace `Code.gs` content with [Code.js](https://github.com/nuzulul/decap-cms-google-apps-script/blob/main/src/server/Code.js)\n- Add a new HTML file with a name `config.html` and then replace the content with [config.html](https://github.com/nuzulul/decap-cms-google-apps-script/blob/main/src/server/config.html)\n- Click `Deploy` \u003e `New deployment` \u003e `Select type` \u003e `Web app`\n- Set `Configuration` \u003e `Web app` \u003e `Execute as` to `Me`\n- Set `Configuration` \u003e `Web app` \u003e `Who has access` to `anyone`\n- Click `Deploy`\n- Click `Authorize access`\n- Click your google account\n- Click `Go to decap (unsafe)`\n- Click `Allow`\n- Copy the `web app url`\n\n### 2. Create OAuth application at Github\n\n- Go to [https://github.com/settings/developers](https://github.com/settings/developers)\n- Create `New OAuth app`\n- Set `Application name` to anything you like\n- Set `Homepage URL` to your site’s URL\n- Set `Authorization callback URL` to web app url above\n- Clik `Register application`\n- Generate a `Client Secret`\n- Copy the `Client ID` and `Client Secret`\n\n### 3. Create OAuth2 with PKCE client\n\n- Copy [client.html](https://github.com/nuzulul/decap-cms-google-apps-script/blob/main/src/client/client.html) file to your Decap CMS `admin` directory or any directory you will publish it.\n- Update the configuration\n```javascript\nlet client_config = {\n    github_client_id : '12345',\n    apps_script_url : 'https://script.google.com/macros/s/SCRIPTID/exec',\n    pkce_client_endpoint : 'https://example.com/admin/client.html'\n}  \n```\n- Set `github_client_id` to `Client ID` above\n- set `apps_script_url` to `web app url` above\n- Set `pkce_client_endpoint` to this PKCE client.html location\n\n### 4. Configure Decap CMS\n\n- Update your Decap CMS `config.yml`\n```yaml\nbackend:\n  name: github # backend to use\n  repo: username/repo # your username and repo\n  branch: main # branch to use\n  base_url: https://example.com # PKCE client.html hostname (just the base domain, no path)\n  auth_endpoint: /admin/client.html # PKCE client.html path\n```\n\n### 5. Update Google Apps Script project configuration\n\n- Finally, update `config.html` in Google Apps Script project above\n```json\n{\n  \"github_client_id\":\"12345\",\n  \"github_client_secret\":\"12345\",\n  \"pkce_client_endpoint\":\"https://example.com/admin/client.html\"\n}\n```\n- Set `github_client_id` to `Client ID` above\n- Set `github_client_secret` to `Client Secret` above\n- Set `pkce_client_endpoint` to PKCE client.html location above\n- Click `Deploy` \u003e `Manage deployments` \u003e `Edit`\n- Set `Configuration` \u003e `Version` to `New version`\n- Click `Deploy`\n\n### 6. Publish\n\nPublish your Decap CMS and open it on your browser, now you should see a Login with Github button","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuzulul%2Fdecap-cms-google-apps-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuzulul%2Fdecap-cms-google-apps-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuzulul%2Fdecap-cms-google-apps-script/lists"}