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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ado-connector

v1.0.1

Published

A simple, powerful library to expose Azure DevOps (ADO) capabilities in your Next.js application

Downloads

180

Readme

ADO Connector for Next.js

npm version Publish to NPM

A simple, powerful library to expose Azure DevOps (ADO) capabilities in your Next.js application.

Installation

npm install ado-connector
# or
yarn add ado-connector

Usage

1. Set up Environment Variables

Ensure you have the following environment variables in your .env.local:

ADO_ORG=your-organization
ADO_PROJECT=your-project
ADO_PAT=your-personal-access-token

2. Create the API Route

Create a file at app/api/ado/[[...ado]]/route.ts (App Router) or pages/api/ado/[[...ado]].ts (Pages Router).

App Router (app/api/ado/[[...ado]]/route.ts):

import { createAdoHandler } from 'ado-connector';

const handler = createAdoHandler({
  organization: process.env.ADO_ORG!,
  project: process.env.ADO_PROJECT!,
  pat: process.env.ADO_PAT!,
});

export { handler as GET, handler as POST };

3. Access the API

Now your application exposes the following endpoints:

Read Operations (GET)

  • GET /api/ado/pipelines: List all pipelines (enriched with latest run and artifacts).
  • GET /api/ado/pipelines?mode=simple: List all pipelines (basic info).
  • GET /api/ado/pipelines?mode=simple&top=10&skip=0: List pipelines with pagination.
  • GET /api/ado/pipelines/:id: Get pipeline details.
  • GET /api/ado/pipelines/:id/runs: Get runs for a pipeline.
  • GET /api/ado/pipelines/:id/runs?top=20&skip=0: Get runs with pagination.
  • GET /api/ado/pipelines/:id/runs/:runId: Get a specific run.
  • GET /api/ado/builds/:id/artifacts: Get artifacts for a specific build.

Write Operations (POST)

  • POST /api/ado/pipelines/:id/runs: Trigger a new pipeline run.

4. Triggering Pipeline Runs

You can trigger a pipeline run by sending a POST request:

// Trigger a pipeline run on the default branch
const response = await fetch('/api/ado/pipelines/123/runs', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({})
});

// Trigger a pipeline run on a specific branch
const response = await fetch('/api/ado/pipelines/123/runs', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    resources: {
      repositories: {
        self: {
          refName: 'refs/heads/main'
        }
      }
    }
  })
});

// Trigger with template parameters and variables
const response = await fetch('/api/ado/pipelines/123/runs', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    templateParameters: {
      environment: 'production'
    },
    variables: {
      myVar: { value: 'myValue' },
      secretVar: { value: 'secret', isSecret: true }
    }
  })
});

Features

  • Easy Integration: Plug and play with Next.js Route Handlers.
  • Type Safe: Written in TypeScript with full type definitions.
  • Enriched Data: Automatically aggregates pipeline runs and artifacts for a comprehensive view.
  • Pipeline Triggers: Trigger pipeline runs with custom parameters and variables.