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

@loopstack/oauth-examples

v0.1.3

Published

Workflow examples for OAuth-protected integrations in Loopstack — GitHub repos overview, GitHub agent, Google Calendar summary, Google Workspace agent.

Readme


title: OAuth Examples description: Workflow examples for OAuth-protected integrations in Loopstack — GitHub repos overview and chat agent, Google Calendar summary and Google Workspace chat agent. Each pair demonstrates the same shape - scripted single-pass workflow + interactive agent with auto-OAuth retry.

@loopstack/oauth-examples

OAuth integration workflow examples for the Loopstack automation framework.

Two integration patterns demonstrated for two providers. Each provider has:

  • A scripted overview/summary workflow — single-pass, hand-rolled tool sequence
  • An interactive agent workflow — Claude with the full tool set, OAuth auto-retry

Both shapes share the same OAuth retry pattern: on unauthorized error, launch the OAuth sub-workflow inline, then retry from start.

Install as Source (Recommended)

npx giget@latest gh:loopstack-ai/loopstack/registry/examples/oauth-examples src/oauth-examples

Then register the module:

import { Module } from '@nestjs/common';
import { LoopstackModule } from '@loopstack/loopstack-module';
import { OAuthExamplesModule } from './oauth-examples/oauth-examples.module';

@Module({
  imports: [LoopstackModule.forRoot(), OAuthExamplesModule],
})
export class AppModule {}

Install as a Dependency

npm install @loopstack/oauth-examples
import { OAuthExamplesModule } from '@loopstack/oauth-examples';

Required app-module configuration

The Agent examples (GitHub Agent, Google Workspace Agent) use Claude via @loopstack/llm-provider-module@Global, configured once in your root module to set the default model:

import { Module } from '@nestjs/common';
import { LlmProviderModule } from '@loopstack/llm-provider-module';
import { LoopstackModule } from '@loopstack/loopstack-module';
import { OAuthExamplesModule } from '@loopstack/oauth-examples';

@Module({
  imports: [LoopstackModule.forRoot(), LlmProviderModule.forRoot({ model: 'claude-sonnet-4-6' }), OAuthExamplesModule],
})
export class AppModule {}

OAuthExamplesModule re-imports ClaudeModule, GitHubModule, and GoogleWorkspaceModule. The latter two transitively pull in the global OAuthModule and register the provider implementations — no additional OAuth wiring required in your AppModule. LlmProviderModule.forRoot(...) sets the default model for the agent workflows.

The scripted (non-agent) overview/summary workflows also use Claude for the markdown rendering step, so LlmProviderModule.forRoot(...) is required for them too.

Environment

ANTHROPIC_API_KEY=sk-ant-...
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...

Refer to @loopstack/github-module and @loopstack/google-workspace-module for the full OAuth setup (redirect URLs, scopes).

Examples

| Example | Studio title | Description | | --------------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------- | | GitHub Overview | OAuth - GitHub Overview Example | Scripted walk of GitHub read tools with markdown summary | | GitHub Agent | OAuth - GitHub Agent Example | Interactive Claude agent with 25 GitHub tools | | Google Calendar Summary | OAuth - Google Calendar Summary Example | Scripted calendar fetch + markdown summary | | Google Workspace Agent | OAuth - Google Workspace Agent Example | Interactive Claude agent with Calendar, Gmail, and Drive tools |


GitHub Overview

A scripted (non-agent) GitHub workflow that walks every major GitHub read tool: user info, orgs, repo details, branches, issues, PRs, directory contents, workflow runs, and code search. On any unauthorized error it pauses, launches the OAuthWorkflow sub-workflow inline, then retries from the start.

Files

  • github-overview-example.workflow.ts — workflow class
  • templates/repoOverview.md — Handlebars markdown summary template

GitHub Agent

An interactive Claude chat agent with 25 GitHub tools wired in: repos, issues, PRs, code, actions, and search. When a tool returns unauthorized, the agent calls authenticateGitHub to launch the OAuth sub-workflow and retries.

Files

  • github-agent-example.workflow.ts — workflow class
  • github-agent-example.ui.yaml — chat prompt-input widget
  • templates/systemMessage.md — system prompt

Google Calendar Summary

Fetches the user's upcoming calendar events via GoogleCalendarFetchEventsTool and renders a markdown summary. On unauthorized it launches the OAuthWorkflow sub-workflow inline and retries.

Files

  • google-calendar-summary-example.workflow.ts — workflow class
  • templates/calendarSummary.md — Handlebars markdown summary

Google Workspace Agent

An interactive Claude chat agent with 11 Google Workspace tools (Calendar, Gmail, Drive). When a tool returns unauthorized, the agent calls authenticateGoogle to launch the OAuth sub-workflow and retries.

Files

  • google-workspace-agent-example.workflow.ts — workflow class
  • google-workspace-agent-example.ui.yaml — chat prompt-input widget
  • templates/systemMessage.md — system prompt

About

Author: Jakob Klippel

License: MIT