New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@loopstack/github-oauth-example

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loopstack/github-oauth-example

An example module demonstrating how to list GitHub repositories and issues with OAuth authentication using the Loopstack automation framework. Shows the sub-workflow pattern for handling OAuth flows.

npmnpm
Version
0.1.1
Version published
Weekly downloads
240
3328.57%
Maintainers
1
Weekly downloads
 
Created
Source

@loopstack/github-oauth-example

An example module for the Loopstack AI automation framework.

This module demonstrates how to build workflows that interact with the GitHub API using OAuth authentication. It includes two workflows: a structured overview that fetches repository data, and an interactive chat agent powered by an LLM that can use all 25 GitHub tools.

Workflows

GitHub Repos Overview (gitHubReposOverview)

A multi-step workflow that fetches and displays a comprehensive overview of a GitHub repository. If the user is not authenticated, it launches the OAuth sub-workflow and retries automatically.

Inputs: owner (default: octocat), repo (default: Hello-World)

Flow:

start -> fetch_user -> fetch_orgs -> fetch_repo_details -> fetch_issues_prs
  -> fetch_content_actions -> fetch_search -> display_results -> end

With OAuth branching:

fetch_user -> (unauthorized) -> auth_required -> awaiting_auth
                                                    |
                                              auth_completed -> start (retry)

Tools exercised in the workflow:

CategoryToolUsed in workflow
UsersgitHubGetAuthenticatedUserYes
UsersgitHubListUserOrgsYes
ReposgitHubListReposNo
ReposgitHubGetRepoYes
ReposgitHubCreateRepoNo
ReposgitHubListBranchesYes
IssuesgitHubListIssuesYes
IssuesgitHubGetIssueNo
IssuesgitHubCreateIssueNo
IssuesgitHubCreateIssueCommentNo
Pull RequestsgitHubListPullRequestsYes
Pull RequestsgitHubGetPullRequestNo
Pull RequestsgitHubCreatePullRequestNo
Pull RequestsgitHubMergePullRequestNo
Pull RequestsgitHubListPrReviewsNo
ContentgitHubGetFileContentNo
ContentgitHubCreateOrUpdateFileNo
ContentgitHubListDirectoryYes
ContentgitHubGetCommitNo
ActionsgitHubListWorkflowRunsYes
ActionsgitHubTriggerWorkflowNo
ActionsgitHubGetWorkflowRunNo
SearchgitHubSearchCodeYes
SearchgitHubSearchReposNo
SearchgitHubSearchIssuesNo

All 25 tools are injected and available; 9 are called directly by the workflow transitions. The remaining 16 (including all write operations) are available for use but not exercised automatically.

GitHub Agent (gitHubAgent)

An interactive chat agent that gives an LLM access to all 25 GitHub tools. The agent can manage repositories, issues, pull requests, browse code, check CI/CD status, search across GitHub, and handle OAuth automatically.

How it works:

  • Sets up a system prompt describing available GitHub capabilities
  • Waits for user input via a chat prompt
  • Sends the conversation to the LLM with all GitHub tools available
  • Executes any tool calls the LLM makes
  • If a tool returns an auth error, launches OAuth and resumes after authentication
  • Loops back to wait for the next user message

This is the easiest way to interactively test every GitHub tool — just ask the agent to perform any GitHub operation.

Setup

Environment Variables

Create a GitHub OAuth App at https://github.com/settings/developers and configure:

GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secret
GITHUB_OAUTH_REDIRECT_URI=http://localhost:5173/oauth/callback

For the GitHub Agent workflow, you also need an LLM API key:

OPENAI_API_KEY=your-openai-api-key

Dependencies

  • @loopstack/core — Core framework functionality including ExecuteWorkflowAsync
  • @loopstack/ai-module — LLM integration (AiGenerateText, DelegateToolCall)
  • @loopstack/oauth-module — OAuth infrastructure (OAuthTokenStore, OAuthWorkflow)
  • @loopstack/github-module — All 25 GitHub tools and the GitHub OAuth provider
  • @loopstack/core-ui-moduleCreateDocument, LinkDocument, MarkdownDocument
  • @loopstack/create-chat-message-toolCreateChatMessage

About

Author: Jakob Klippel

License: Apache-2.0

Additional Resources

Keywords

example

FAQs

Package last updated on 25 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts