This guide walks you through setting up ClipPulse for the first time.
- Google account with access to Google Drive and Google Sheets
- Node.js installed (for clasp)
- clasp CLI installed (
npm install -g @google/clasp)
-
Login to clasp:
clasp login
-
Create a new Apps Script project:
cd /path/to/ClipPulse clasp create --title "ClipPulse" --type webapp --rootDir ./src
-
This will create a
.clasp.jsonfile with your script ID.
clasp pushOpen the Apps Script editor:
clasp openThen go to Project Settings > Script Properties and add the following:
| Key | Description |
|---|---|
CLIPPULSE_ROOT_FOLDER_ID |
Google Drive folder ID for storing artifacts (leave empty, will be auto-created) |
OPENAI_API_KEY |
Your OpenAI API key |
| Key | Description |
|---|---|
META_APP_ID |
Meta (Facebook) App ID |
META_APP_SECRET |
Meta App Secret |
| Key | Default | Description |
|---|---|---|
OPENAI_MODEL |
gpt-4o |
OpenAI model to use |
META_GRAPH_API_VERSION |
v18.0 |
Instagram Graph API version |
MAX_POSTS_PER_PLATFORM_DEFAULT |
30 |
Default posts to collect |
BATCH_SIZE |
15 |
Posts per batch |
MAX_RETRIES |
3 |
Max API retry attempts |
RETRY_BACKOFF_MS |
1000 |
Initial retry delay |
USE_MOCKS |
false |
Enable mock mode for testing |
In the Apps Script editor, run the initialize function:
- Open the script editor (
clasp open) - Select
Code.gs - Select
initializefrom the function dropdown - Click Run
This will:
- Create the root
ClipPulsefolder in Drive - Validate your configuration
If using Instagram:
- Run the
setupAuthfunction to get OAuth URLs - Visit the Meta OAuth URL in your browser
- Authorize the application
- The callback will automatically store your tokens
- In Apps Script editor, go to Deploy > New deployment
- Select Web app as the type
- Set:
- Description: "ClipPulse v1.0"
- Execute as: "User deploying the web app"
- Who has access: "Anyone with a Google account" (or your preference)
- Click Deploy
- Copy the Web App URL
To test without real API calls:
- Set
USE_MOCKStotruein Script Properties - Run
runMockTestfunction - Check the generated spreadsheet
Run the healthCheck function to verify all services are working.
Make sure all required Script Properties are set correctly.
- Ensure your Meta app has the correct permissions
- Try running
resetMetaAuth()and re-authorizing
- Make sure the script has Drive permissions
- Check the root folder exists and is accessible
- Go to https://platform.openai.com/api-keys
- Create a new API key
- Copy and save as
OPENAI_API_KEY
- Go to https://developers.facebook.com/
- Create a new app (Business type)
- Add the Instagram Graph API product
- Configure OAuth redirect URL:
- Get your script's redirect URL by running
getMetaAuthorizationUrl() - Add it to your Meta app's OAuth settings
- Get your script's redirect URL by running
- Get your App ID and App Secret
The Instagram Graph API requires a professional (Business or Creator) Instagram account connected to a Facebook Page:
- Convert your Instagram account to Professional
- Connect it to a Facebook Page you manage
- Use that Facebook Page for the API access