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

msteams

v0.1.7

Published

`msteams` is a lightweight TypeScript library and CLI for interacting with Microsoft Teams endpoints used by the web client.

Readme

teams-api: Micosoft Teams CLI/TS Client

msteams is a lightweight TypeScript library and CLI for interacting with Microsoft Teams endpoints used by the web client.

[!WARNING]

  • This package uses unofficial endpoints. Behavior may change if Microsoft updates those APIs.

CLI

Installation

Temporary running:

npx msteams # npm
bunx msteams # Bun
deno run -A npm:msteams # Deno
pnpm dlx msteams # pnpm

Global install:

npm i -g msteams # npm
bun i -g msteams # Bun
deno install --global -A npm:msteams
pnpm i -g msteams

Install a skill for AI agents:

bunx skills add nakasyou/teams-api

Usage

Help

Show help:

teams --help

Login (recommended)

teams login --ests-auth-persistent=<ESTSAUTHPERSISTENT>
  • Default profile path: ~/.teams-cli/default.json
  • You can change the profile with --profile
  • Running teams login with no token now prompts for ESTSAUTHPERSISTENT in interactive terminals
  • How to obtain ESTSAUTHPERSISTENT:
    1. Use a browser other than Microsoft Edge
    2. Open https://login.microsoftonline.com/common/oauth2/v2.0/authorize in your browser
    3. Open DevTools, go to the Application tab, then Cookies
    4. Copy the ESTSAUTHPERSISTENT cookie value and paste it into the teams login prompt
  • You can also pass token via --ests-auth-persistent or ESTSAUTHPERSISTENT
  • The default profile stores refreshToken, refreshTokenExpiresIn, and ESTSAUTHPERSISTENT.

refresh_token is deprecated and will continue to work for backward compatibility. ( --refresh-token / REFRESH_TOKEN are deprecated in favor of ESTSAUTHPERSISTENT)

Common commands

# Fetch latest notifications (default: 20)
teams notifications [--limit N]

# Fetch conversation messages
teams messages <conversationId> [--limit N]

# Fetch channel messages
teams channel messages <channelId> [--limit N]

# List teams
teams teams list

# List channels in a team
teams teams channels <teamId>

# Fetch current user snapshot
teams me

Common options

  • --json: output only JSON
  • --no-color: disable ANSI colors
  • --profile=<name>: use another local profile name
  • --profile-json=<path>: use a custom profile JSON file
  • --ests-auth-persistent=<token>: set session token for current run (recommended)
  • --refresh-token=<token>: set refresh token for current run (deprecated)
  • --help: show help

Library

import { TeamsClient, TokenManager } from 'msteams'

const tokenManager = new TokenManager(process.env.REFRESH_TOKEN || '')
const client = new TeamsClient(tokenManager)

const me = await client.teams.users.me.fetch()
console.log(me.teams?.length ?? 0, 'teams')
const notifications = await client.teams.notifications.fetchMessages({ pageSize: 10 })
console.log(notifications.messages?.length ?? 0)

Exported API

  • TokenManager
  • ScopeTokenProvider
  • TeamsClient
  • teams.conversations.fetchMessages
  • teams.notifications.fetchMessages, fetchMentions, fetchAnnotations
  • teams.channels.fetch, teams.channels.fetchMessages
  • teams.users.fetchShortProfile
  • teams.users.me.fetch, teams.users.me.fetchPinnedChannels

Development

bun install
bun run fmt
bun run build

The package uses Vite+ to build both library and CLI entry points.

License

MIT