Use Google Drive as a free, simple, headless CMS!
Drive CMS is developed by the team behind GoodForm AI, a startup which helps physical therapy patients get their exercise done at home.
A key part of our strategy is to have lots of educational articles about physical therapy, written by a lot of people.
We researched many existing Content Management Systems, only to find that many of them either require high monthly fees or need to be hosted on a costly private server.
With the power of Google Drive, you get a powerful document editor that everyone knows how to use, and a free API to retrieve your documents as HTML.
We were already using Google Drive to write business documents, spreadsheets, and ideas, and now we can use it to publish content directly to our website!
Well, if you've heard enough, let's get started!
To use Google Drive as a CMS, first you'll have to do some setup in Google Cloud Platform.
- Enable the Google Drive API
- Create a Service Account and obtain its credentials
- Share your website's files with the Service Account's email address
More detailed instructions here: Setting up Google Cloud Platform.
We designed this for easy use in a NextJS application, but it should be easy to use in any server side JavaScript or TypeScript application.
- Install the package in your project with
npm install drive-cms
. - Create an instance of DriveCMS. Here, you can pass in an auth credential. You can authenticate any way GoogleAuth allows. Read more about Authenticating to Google
// src/lib/drive.ts
import DriveCMS from "drive-cms";
export const driveCMS = new DriveCMS({ keyFile: "./credentials.json" });
- Use it in your application!
Keep an eye out for some fancy features we have planned for the future!
- File Hierarchy Routing
- Google Sheets support
- Internationalization
- Internal Linking
- Image Optimization
- YAML Description Metadata
- Code Block Support
- Shortcodes like WordPress or Components like MDX
- Improved error handling
- Improve TypeScript "DriveDocument"
- Configuration in the constructor
- Integration tests
- Automated package deploys
- Improved documentation
- Documentation site on GitHub Pages
- Fix link query param handling
This project is licensed under the MIT License - see the LICENSE file for details.