Align Momentum
← Back to the app
Setup guide

Get set up in about 10 minutes

Nothing to install. You'll need a Google account and an Anthropic API key. Your data lives in a Google Sheet you own — Align Momentum never sees or stores it.

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:

This part matters: "Who has access" must be set to Anyone — not "Anyone with Google account." That option looks similar but silently blocks the app from connecting, since it requires a signed-in Google session that the browser can't provide.

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.

  1. Go to console.anthropic.com and sign up, or log in if you already have an account.
  2. Go to Settings → API Keys (or the "API Keys" link in the left sidebar).
  3. Click Create Key, give it a name (e.g. "Align Momentum"), and click Create.
  4. Copy the key that appears. It starts with sk-ant-. This is the only time the full key is shown, so copy it now.
Note: New Anthropic accounts typically include a small amount of free trial credit, but exact amounts and terms can change — check console.anthropic.com for current details. After any trial credit is used, drafting and consistency checks are billed per use, typically a few cents each.

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

AI drafting isn't working

Back to Align Momentum →