Google App Scripts

Learn how to configure Google App Scripts for use with Filebase.

What are Google App Scripts?

Google Apps Script is a scripting language and development platform that allows users to extend and automate the functionality of various Google products, including Google Sheets, Google Docs, Google Forms, and more. It is a cloud-based platform, which means that developers can write and deploy code directly within their Google Drive or G Suite account.

Read below to learn how to use Google App Scripts with Filebase.

Prerequisites:

1. Start by cloning the following GitHub repository:

git clone https://github.com/jamongeon/s3-http-post-gs.git

2. In the main.js file, replace the following variable values to match your configuration:

const bucket = 'FILEBASE BUCKET NAME';
const accessKeyId = "FILEBASE ACCESS KEY";
const secretAccessKey = "FILEBASE SECRET KEY";
const region = 'us-east-1';
const acl = 'private';

3. Then, install Google Clasp with npm:

npm install -g @google/clasp

4. Login with Google to authenticate the workspace:

clasp login

This command will require that you log into your Google account and authorize Google App Scripts.

5. Next, open the Google App Scripts settings page and enable the Google Apps Script API:

6. Create the Google App Scripts project with the following commands:

clasp create --type standalone --title "S3 http post"

clasp push

clasp open

7. Your project will be opened in your web browser. Select ‘Deploy’ to run your script.

8. Then select ‘New Deployment’. For the deployment type, select ‘API Executable’, then give your app a name and description.

9. Then select ‘Deploy’. You will be prompted to authorize access to the web app with your Google account.

10. Once authenticated, your app will deploy.

11. Then, select ‘Run’ from the script editor when viewing the main.gs file to run your script.

This script is configured to use two example files to upload. Change these files to reflect what files you’d like to upload to Filebase.

If you have any questions, please join our Discord server, or send us an email at hello@filebase.com

Last updated