Online database API powered by Google Drive

Setting up


Step 1: Get Google Credentials

  1. Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.
  2. At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name if not already set, and click the Save button.
  3. Select the Credentials tab, click the Create credentials button and select OAuth client ID. Select "Web application"
  4. Insert the base url of your project as the authorized JavaScript origin. Also insert xenonmolecule.github.io, so you can complete step 3
  5. Insert where you want oauth to take the user upon authorization into the redirect URIs field
  6. Select "Create Client ID"
  7. Take note of your newly created client ID, you will need it for the third & fourth step.


Step 2: Inserting Necessary Files

insert these files into the head of the html

<script src="https://apis.google.com/js/api.js"></script>
<script src="https://www.gstatic.com/realtime/realtime-client-utils.js"></script>
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="http://xenonmolecule.github.io/BASE95/BASE95.js"></script>
<script src="YOUR-JS-FILE"></script>

then, insert this into the body

<div id="BASE95">
</div>

and insert this somewhere you want a button to authorize users

<button id="auth_button">Authorize</button>

Step 3: Create BASE95 workspace on google docs

Click on this button to initialize a BASE95 workspace



Make Workspace

Step 4: Initialize a BASE95 Project

In your JS file type the following: var WORKSPACE-NAME = new b95(CLIENT-ID(from step 1),DOCUMENT-ID(from step 3));

You are now ready to use this powerful api!

Demos


Button Realtime Update Click Counter

Methods


.add(name,value[,path])

adds a defined value-name pair to a specified location in the document
Parameter Usage Type
name the property name you wish to add string
value the value you wish to assign to the property any
[path] the path of objects that the code has to search through to find the location of the value you wish to add, seperated by forward slashes(/), and ending in a forward slash, if left blank, value added without parent objects string

.change(name,value[,path])

changes the value of an existing property
Parameter Usage Type
name the property name you wish to change string
value the value you wish to assign to the property any
[path] the path of objects that the code has to search through to find the location of the value you wish to change, seperated by forward slashes(/), and ending in a forward slash, if left blank, value changed without parent objects string

.remove(name[,path])

takes property and removes it
Parameter Usage Type
name the property name you wish to remove string
[path] the path of objects that the code has to search through to find the location of the value you wish to remove, seperated by forward slashes(/), and ending in a forward slash, if left blank, value changed without parent objects string



.read([path])

returns value of the main object
Parameter Usage Type
[path] the path of objects that the code has to search through to find the location of the value you wish to read, seperated by forward slashes(/), and ending in a forward slash, if left blank, value changed without parent objects string