A walkthrough and more details are available on Google Drive SDK docs.
-
Clone DrEdit's git repo and init submodules:
git clone [email protected]:googledrive/dredit.git && cd dredit git submodule init git submodule update --recursive
-
Create an API project in the Google APIs Console.
-
Select the Services tab in your API Project, and enable the Drive API and Drive SDK.
-
Select the API Access tab in your API Project, click Create an OAuth 2.0 client ID.
-
In the Branding Information section, provide a name for your application (e.g. "DrEdit"), and click Next. Providing a product logo or a homepage URL is optional.
-
In the Client ID Settings section, do the following:
- Select Web application for the Application type
- Click the more options link next to the heading, Your site or hostname.
- List the URI of your application's URL in the Authorized Request URIs and JavaScript Origins fields.
- Click Create Client ID.
-
Register DrEdit as described in Enable the Drive SDK using the following values:
- Set the default MIME types
text/plain
andtext/html
, and the default extensionstxt
andhtml
. - Ensure that the set of redirect URIs includes the URI of your application. The same URL must be provided for the
Open URL
andCreate URL
fields. - Add the
Google API Scopes
ofhttps://www.googleapis.com/auth/userinfo.email
,https://www.googleapis.com/auth/userinfo.profile
andhttps://www.googleapis.com/auth/drive.install
. - For icons, use the example icons provided in the
chromewebstore
directory.
- Set the default MIME types
-
Copy the contents of the
php/
directory to a directory under your web server's root directory. -
Modify the
credentials.php
file to include the values you obtained when registering your app, found in the Google APIs Console under the API Access tab for the project. This includes your OAuth client ID and client secret. You will also need to specify the database host, username and password. Note: Make sure you use a valid Client ID for web applications. Do not use the Client ID for Drive SDK, which is reserved for future feature development. -
Test the application.
-
Continue reading to find out how DrEdit is constructed, and how to modify it to work for your own application's needs.