1 Create your Google Sheet
Go to sheets.google.com and create a new blank spreadsheet. This is where all your board updates, briefings, and log entries will live.
2 Rename the tab to "Log"
At the bottom of the sheet, right-click the "Sheet1" tab, choose Rename, and type exactly:
Log
The tab name must be exactly "Log" with a capital L. If it's spelled differently, the app won't be able to read or write to it.
3 Add the Apps Script
In your Google Sheet, click Extensions > Apps Script. A new tab opens with a code editor. Select all of the placeholder code (Ctrl+A / Cmd+A) and delete it, then paste in the code below:
function doGet(e) { return handleRequest(e); }
function doPost(e) {
var p = JSON.parse(e.postData.contents);
return handleAction(p);
}
function handleRequest(e) {
var p = e.parameter;
return handleAction(p);
}
function handleAction(p) {
var out = {};
if (p.action === "headers") {
out = { headers: ["ID","Date","Type","Audience","Title",
"Content","Status","Tags","AddedAt","Notes"] };
} else if (p.action === "read") {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Log");
var rows = sheet.getDataRange().getValues();
out = { rows: rows };
} else if (p.action === "append") {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Log");
var row = JSON.parse(p.row);
sheet.appendRow(row);
out = { success: true };
} else if (p.action === "update") {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Log");
sheet.getRange(parseInt(p.row), parseInt(p.col)).setValue(p.value);
out = { success: true };
} else if (p.action === "clear") {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Log");
sheet.getRange(parseInt(p.row), 1, 1, 10).clearContent();
out = { success: true };
} else if (p.action === "ai_suggest") {
var apiKey = p.apiKey;
var prompt = p.prompt;
if (!apiKey || !prompt) {
out = { error: "Missing apiKey or prompt" };
} else {
var payload = JSON.stringify({
model: "claude-sonnet-5",
max_tokens: 8000,
messages: [{ role: "user", content: prompt }]
});
var options = {
method: "post",
contentType: "application/json",
headers: { "x-api-key": apiKey,
"anthropic-version": "2023-06-01" },
payload: payload,
muteHttpExceptions: true
};
try {
var resp = UrlFetchApp.fetch(
"https://api.anthropic.com/v1/messages", options);
var result = JSON.parse(resp.getContentText());
if (result.content && result.content[0]) {
out = { suggestion: result.content[0].text };
} else if (result.error) {
out = { error: result.error.message || "API error" };
} else {
out = { error: "No response from AI" };
}
} catch(err) {
out = { error: err.message };
}
}
} else {
out = { error: "unknown action" };
}
return ContentService
.createTextOutput(JSON.stringify(out))
.setMimeType(ContentService.MimeType.JSON);
}
Save with Ctrl+S / Cmd+S. The file should show as Code.gs.
4 Deploy as a web app
Click the blue Deploy button (top right), then New deployment. Click the gear icon next to "Select type" and choose Web app. Set:
- Execute as: Me
- Who has access: Anyone
Click Deploy, then Authorize access. You'll see a "Google hasn't verified this app" warning — this is expected since it's your own script. Click Advanced, then "Go to (project name) (unsafe)," then Allow.
5 Copy the web app URL
After authorizing, you'll see a URL like:
https://script.google.com/macros/s/XXXXXXXXXX/exec
Click Copy next to it. If you ever need to find it again, it's under Deploy > Manage deployments in the Apps Script editor.
6 Get an Anthropic API key
Align Momentum calls Anthropic's API directly from your browser with your own key — there's no Align Momentum account to create.
- Go to console.anthropic.com and sign up, or log in if you already have an account.
- Go to Settings → API Keys (or the "API Keys" link in the left sidebar).
- Click Create Key, give it a name (e.g. "Align Momentum"), and click Create.
- Copy the key that appears. It starts with
sk-ant-. This is the only time the full key is shown, so copy it now.
7 Connect the app
Go back to Align Momentum, paste your Web App URL and Anthropic API key into the setup screen, and click "Connect my sheet." You can add or update your API key any time in Settings.
Troubleshooting
"Could not connect" error
- Check that "Who has access" is set to Anyone, not "Anyone with Google account" (see step 4).
- Make sure you copied the full Web App URL, including
/execat the end. - Confirm the sheet tab is named exactly
Log. - If you edited the script after deploying, redeploy: Deploy > Manage deployments > pencil icon > New version > Deploy.
AI drafting isn't working
- Your Anthropic API key must start with
sk-ant-. - Add or update your key any time in Settings (top right of the app once connected).