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

@stackoverflow/teams-sdk

v1.4.0

Published

SDK for the Stack Overflow Teams API

Readme

Stack Overflow Internal SDK

A comprehensive TypeScript/JavaScript SDK for interacting with the Stack Internal API. This toolkit provides easy-to-use methods for accessing questions, answers, users, and other resources in your Stack Internal instance.

Features

  • 🚀 Simple API wrapper - Clean, intuitive interface for all Stack Internal endpoints
  • 🔒 OAuth2 authentication - Built-in support for access token authentication
  • 📦 Modular design - Organized client modules for different resource types
  • 🎯 Team context support - Switch between different teams seamlessly
  • 📝 Full TypeScript support - Complete type definitions for all API responses
  • 🔄 Future-proof - Always up-to-date with the latest API specification

Installation

npm install @stackoverflow/teams-sdk
yarn add @stackoverflow/teams-sdk

Quick Start

Basic Setup

import { StackOverflowSDK } from '@stackoverflow/teams-sdk';

const sdk = new StackOverflowSDK({
  accessToken: 'your-oauth2-access-token',
  baseUrl: 'https://[your-site].stackenterprise.co/api/v3'
});

Working with Questions

// Get all questions
const questions = await sdk.questions.getAll();

// Get a specific question
const question = await sdk.questions.get('question-id');

// Search questions
const searchResults = await sdk.search.search({
  query: 'typescript',
  tags: ['javascript', 'node.js']
});

Working with Answers

// Get answers for a question
const answers = await sdk.answers.getAll('question-id');

// Get a specific answer
const answer = await sdk.answers.get('answer-id');

Team Context

For team scenarios, you can create team-specific contexts:

const teamContext = sdk.forTeam('team-id');

// Now all operations are scoped to this team
const teamQuestions = await teamContext.questions.getAll();

Available Clients

The SDK provides dedicated clients for each resource type:

| Client | Description | Example Usage | |--------|-------------|---------------| | answers | Answer operations | sdk.answers.get(id) | | questions | Question operations | sdk.questions.getAll() | | articles | Article/documentation | sdk.articles.getAll() | | collections | Question collections | sdk.collections.getAll() | | comments | Comments on posts | sdk.comments.getAll() | | users | User management | sdk.users.getAll() | | tags | Tag operations | sdk.tags.getAll() | | search | Search functionality | sdk.search.query() | | usergroups | User group management | sdk.usergroups.getAll() | | communities | Community operations | sdk.communities.getAll() |

Configuration

SDKConfig Interface

interface SDKConfig {
  accessToken: string;  // OAuth2 access token
  baseUrl: string;      // API base URL
}

Authentication

Basic and Business customers can follow the official Stack Internal guide to create a Personal Access Token (PAT) for API authentication:

👉 Personal Access Tokens (PATs) for API Authentication

Enterprise users can follow:

👉 Secure API Token Generation with OAuth and PKCE

const sdk = new StackOverflowSDK({
  accessToken: process.env.SO_TEAMS_ACCESS_TOKEN,
  baseUrl: 'https://[your-site].stackenterprise.co/api/v3'
});

Error Handling

try {
  const question = await sdk.questions.get('invalid-id');
} catch (error) {
  if (error.status === 404) {
    console.log('Question not found');
  } else {
    console.error('API Error:', error.message);
  }
}

Pagination

Many API endpoints support pagination:

const questions = await sdk.questions.getAll({
  page: 1,
  pageSize: 50,
  sort: 'creation',
  order: 'desc'
});

console.log(`Total questions: ${questions.total}`);
console.log(`Current page: ${questions.page}`);
console.log(`Total Pages: ${questions.totalPages}`);

API Reference

For detailed API documentation, please refer to:

  • https://[your-site].stackenterprise.co/api/v3
  • Generated TypeScript definitions in your IDE

Support

  • 🐛 Report issues on GitHub