npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@superdurable/connector-google-sheets

v0.2.1

Published

Google Sheets operations for Dex Flows

Downloads

623

Readme

Google Sheets connector for TypeScript

This package binds getValues, findRow, and upsertRow to Dex Steps. The google-sheets-contacts example in examples/upsert-contact/ is a runnable Flow that reads a stable contact key and replaces or appends a row. The upsert uses a durable single dispatch fence before an append and confirms an unknown outcome by reading the key again. An unconfirmed append is resent until the send cap (maxSends, default 3); only an append still unconfirmed at the cap is uncertain, and a definite refusal is never resent.

Use newProjectConnection(project, ConnectionName) in a Worker after loading Dex project configuration. The generated OAuth refresh driver exchanges stored Google refresh tokens, checks the drive.file scope, and persists refreshed credentials through the host. Keep credentials in Dex Web Connections, never in Flow input or persisted Attributes.

Run npm run check for the package suite and DEX_FLOW_SERVICE_ADDRESS=127.0.0.1:<dex-port> npm run test:integration against dexcli dev. The integration test starts a local Sheets stand-in on an OS assigned port and exercises the example through a real Dex Worker and Client. Live Google OAuth consent, spreadsheet selection, and API writes are unverified.

rowAdded Trigger

Version 0.2.0, on @superdurable/connectors-sdk 0.12.0, adds the polled rowAdded Trigger at behavior parity with the Go connector. It delivers each non-empty row appended below the last processed row of one picked tab:

  • The first poll seeds the cursor at the tab's current last row without delivering existing rows.
  • Each later poll makes one values:batchGet request for the header row and up to pollPageSize rows after the cursor, such as 'Leads'!12:112; a full page is followed at once by the next one, and blank rows are skipped.
  • RowAddedEvent carries spreadsheetId, sheetName, rowNumber, header-keyed values, and ordered cells. Its event ID, row-<row number>-<hash>, is a pure function of the tab, row number, and cells.
  • The cursor stores the last processed row number and a SHA-256 of its cells. A cursor row moved by deletes or inserts above it is found again, an edited cursor row keeps its number, and a tab that now ends above the cursor reseeds and logs the gap. The cursor token, row hashes, and event IDs match the Go connector byte for byte, so Go and TypeScript replicas share one cursor.
  • HTTP 429 pauses every binding of the connection for at least its Retry-After; other failed polls back off up to five minutes.

newProjectRowAddedTriggerRunner opens the connection from the loaded project, decodes each route's saved binding, and keeps a durable cursor beside each binding's Trigger inbox, as examples/new-row-intake/app.ts does:

const runner = newProjectRowAddedTriggerRunner(project, ConnectionName, [{ bindingName: NewRowTriggerBinding, target: newAddedRowTarget(client, flow, options.logger) }], { ...options.spreadsheetOptions, triggerLogger: options.logger });

newRowAddedTriggerRunner takes explicit routes with cursors and targets, and newRowAddedTrigger builds one binding's TriggerRunner with an in-memory cursor, so a restart seeds again; use it only in tests or applications without project storage. Records go to the client's triggerLogger and carry the binding identity and row numbers, never cell values, tab titles, or tokens. The Go connector's WithLogger option is SpreadsheetClientOptions.triggerLogger, and pollInterval is Config.pollIntervalMs; newProjectConnection converts the stored Go nanoseconds.

The integration test in test/integration/new-row-intake.integration.test.ts runs the example Flow on a real Dex Worker against a loopback fake Sheets tab. Polling a live Google spreadsheet has not been verified.