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

@flink-app/google-sheets-plugin

v2.0.0-alpha.61

Published

Flink plugin for reading and writing Google Sheets using service account authentication

Downloads

127

Readme

@flink-app/google-sheets-plugin

Read and write Google Sheets from a Flink app using service account authentication.

Prerequisites

  1. Create a service account in Google Cloud Console → IAM & Admin → Service Accounts
  2. Enable the Google Sheets API for your project
  3. Share your spreadsheet with the service account email (Editor access)

Register the plugin

import { googleSheetsPlugin, GoogleSheetsPluginCtx } from "@flink-app/google-sheets-plugin";

interface AppCtx extends FlinkContext<GoogleSheetsPluginCtx> {
    repos: {};
}

new FlinkApp<AppCtx>({
    plugins: [
        googleSheetsPlugin({
            spreadsheetId: process.env.GOOGLE_SPREADSHEET_ID!,
            credentials: {
                clientEmail: process.env.GOOGLE_SERVICE_ACCOUNT_EMAIL!,
                privateKey: process.env.GOOGLE_PRIVATE_KEY!,
            },
        }),
    ],
});

The private key accepts a raw PEM string (with \n) or a base64-encoded service account JSON blob.

Usage

Access the API via ctx.plugins.googleSheets. Use .sheet("Title") or .sheetByIndex(n) to scope operations to a specific sheet.

// Read all rows
const rows = await ctx.plugins.googleSheets.sheet("Tasks").getRows();
// [{ rowIndex: 0, data: { title: "Fix bug", status: "pending" } }, ...]

// Append a row
const row = await ctx.plugins.googleSheets.sheet("Tasks").appendRow({
    title: "New task",
    status: "pending",
});

// Update a row
await ctx.plugins.googleSheets.sheet("Tasks").updateRow(row.rowIndex, {
    status: "completed",
});

// Delete a row
await ctx.plugins.googleSheets.sheet("Tasks").deleteRow(row.rowIndex);

// Spreadsheet metadata
const info = await ctx.plugins.googleSheets.getInfo();
// { title, spreadsheetId, sheetCount }

Rows are plain objects: { rowIndex: number, data: Record<string, string> } where keys are column headers.

Dynamic credentials

Load credentials from the database at startup instead of env vars:

googleSheetsPlugin({
    loadCredentials: async (ctx) => {
        const config = await ctx.repos.configRepo.getOne({ key: "google" });
        return {
            credentials: {
                clientEmail: config.serviceAccountEmail,
                privateKey: config.privateKey,
            },
            spreadsheetId: config.spreadsheetId,
        };
    },
});

AI tool

A generic GoogleSheetsTool is included for use with Flink agents. It supports getRows, appendRow, updateRow, deleteRow, and getInfo operations.

import GoogleSheetsTool, { Tool } from "@flink-app/google-sheets-plugin/tools/GoogleSheetsTool";

class MyAgent extends FlinkAgent<AppCtx> {
    tools = [{ ...Tool, handler: GoogleSheetsTool }];
}