Google Apps Script × Slack

GASlacker

Move your team’s conversation,
straight from your sheets.

No build environment needed. Add one library ID and you are ready for morning digests, scheduled messages, and file uploads.

MIT License

Start in 5 minutes

If you can use Sheets and the Apps Script editor, just follow along.

1

Add the library

In the Apps Script editor, press next to “Libraries”, paste this ID, hit “Look up”, pick the latest version and “Add”.

101aZZYpRRnr5AGkVIo8t_yo4kHb7xryLfq3w-HVPpQ4fX0Tkxv3UJyzc
2

Get a Slack token

This is all the Slack-side setup (one time, about 3 minutes):

  1. At api.slack.com/apps, Create New App → From scratch (any name, pick your workspace)
  2. In OAuth & Permissions, add chat:write to Bot Token Scopes (add files:write for file uploads)
  3. At the top of the same page, Install to Workspace → Allow
  4. Copy the Bot User OAuth Token (starts with xoxb-)
  5. In Apps Script, save it under Project Settings → Script properties as SLACK_ACCESS_TOKEN
  6. Run /invite @YourApp in the target channel (skipping this causes not_in_channel)
3

Post in 3 lines

Paste into the editor and run hello. The channel ID is at the bottom of “View channel details”.

var token = PropertiesService.getScriptProperties().getProperty('SLACK_ACCESS_TOKEN');
var slack = GASlacker.methods(token);

function hello() {
  var res = slack.chat.postMessage({ channel: 'C0123456789', text: 'Hello from GAS!' });
  Logger.log(res.ok ? 'Posted!' : 'Error: ' + res.error);
}

If it fails, check res.error in the log: not_in_channel → step 2-6, invalid_auth → check the property name.

What you can do

Call all 168 Slack Web API methods by their own names. Copy-paste scripts live in examples/.

Morning digests from Sheets

A time trigger + chat.postMessage. Block Kit for pretty formatting.

Scheduled messages

Use chat.scheduleMessage to post at the right time.

Send files

Post CSVs and logs with a single files.uploadV2 call.

Walk every channel

slack.paginate() follows cursor pagination for you.

Canvases & Lists

New APIs such as canvases.* / slackLists.* are covered.

Call anything

slack.call('method.name', params) reaches any API.

// Example: post sheet contents every morning (set a time trigger)
function dailySummary() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('KPI');
  var lastRow = sheet.getLastRow();
  if (lastRow < 2) return;
  var rows = sheet.getRange(2, 1, lastRow - 1, 2).getValues();
  var lines = rows.map(function (r) { return '• ' + r[0] + ': *' + r[1] + '*'; });
  slack.chat.postMessage({ channel: 'C0123456789', text: lines.join('\n') });
}

Built to be trusted

Your token stays yours

Requests go only to the Slack API. The token lives in your Script properties.

TypeScript ready

Type definitions ship for clasp + TypeScript users — every method autocompletes.

FAQ

Is it free?

Yes — MIT-licensed OSS, free for commercial use. Apps Script and Slack apps also run within free tiers for typical use.

Do I need Node.js or a build step?

No. Everything happens in the browser-based Apps Script editor — just add the library ID.

How is this different from Incoming Webhooks?

Webhooks mostly post to one fixed channel. GASlacker calls the Web API, so you also get replies, reactions, files, history, and Canvases.

What if I hit an error?

Errors include a machine-readable res.error value. Still stuck? Issues — any language welcome.

Is this an official Slack library?

No — it is an unofficial community OSS. Slack is a trademark of Slack Technologies, LLC.