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

sp-proxy-server

v1.0.8

Published

Server for proxying SharePoint data to local development machine

Readme

SharePoint REST API Proxy

This project provides a SharePoint REST API proxy server for SharePoint operations. It acts as a direct local/dev proxy to SharePoint REST API with Azure Entra authentication, allowing you to use live SharePoint data with PnP.js and other SharePoint REST clients during app development.

Features

  • Direct SharePoint REST API - forwards requests directly to SharePoint for full compatibility
  • Multi-site tenant support - access any SharePoint site in your tenant through one proxy
  • OAuth2 authentication via Azure AD app registration with authorization code flow
  • Full SharePoint REST API compatibility - supports all operations that work with sp-rest-proxy
  • PnP.js compatible - works seamlessly with existing PnP.js code
  • Node.js v24+ support - compatible with all LTS and current Node.js versions

Node.js Compatibility

This proxy server supports Node.js 18.x and higher, including the latest Node.js v24+.

Recent Improvements:

  • v1.0.8+: Fixed main module detection to work reliably across all Node.js versions (v18-v24+)
  • Uses fileURLToPath and path.resolve() for robust ES module compatibility
  • No breaking changes - existing code continues to work as expected

Setup

1. Azure AD App Registration

Your app registration should have:

  • Application Type: Public client (native)
  • Tenant ID
  • Application ID
  • Permissions:
    • SharePoint AllSites.FullControl (Delegated) or similiar scopes

2. Configuration

Add a file in the root of your project, server.js:

import RestProxy from 'sp-proxy-server';
 
const settings = {
  "siteUrl": "https://somesite.sharepoint.com",
  "tenantId": "yourtenantid",
  "clientId": "yourclientid",
  "scopes": ["AllSites.FullControl"]
}
 
const restProxy = new RestProxy(settings);
restProxy.serve();

Note: The siteUrl is set to your tenant root URL to enable multi-site access. Individual site URLs are specified in your client application requests.

Usage

Start the SharePoint REST API Proxy Server

node server.js

On first run, you'll need to authenticate:

  1. The server will automatically open your browser for OAuth2 authentication
  2. Sign in with your Microsoft account that has access to SharePoint
  3. Grant the requested permissions
  4. The server will start once authenticated and display the proxy URL

Configure Your Client Application

For PnP.js, configure your service to use the proxy:

// In your SharePointService.js or similar
import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
import "@pnp/sp/lists";
import "@pnp/sp/items";

// For development (using proxy)
const sp = spfi("http://localhost:8081/sites/your-site-name");

// For production 
// const sp = spfi("https://yourtenant.sharepoint.com/sites/your-site-name");

Multi-site Usage: You can access different SharePoint sites by changing the URL:

// Access different sites in your tenant
const sp1 = spfi("http://localhost:8081/sites/site1"); 
const sp2 = spfi("http://localhost:8081/sites/site2");

Start Your Development App

In a separate terminal:

npm run dev

API Endpoints Supported

The proxy server forwards ALL SharePoint REST API requests directly to SharePoint, maintaining full compatibility.

Troubleshooting

Authentication Issues

  • Ensure your app registration has the correct delegated permissions (AllSites.FullControl recommended)
  • Make sure you're signing in with an account that has access to SharePoint sites
  • Check that the tenant ID and client ID are correct in config/private.json
  • If authentication fails, restart the server to re-authenticate

Site Access Issues

  • Verify the site name in your URLs matches the actual SharePoint site URL
  • Ensure your account has appropriate permissions to the specific SharePoint site
  • Check that the tenant URL is correct
  • For new sites, wait a few minutes for permissions to propagate

Proxy Connection Issues

  • Ensure the proxy server is running on http://localhost:8081
  • Check that no other services are using port 8081
  • Verify your client application is configured to use http://localhost:8081/sites/[site-name]

Development vs Production

  • In development, the proxy runs on localhost:8081
  • Configure your client to use the proxy URL: http://localhost:8081/sites/[site-name]
  • In production, switch back to direct SharePoint URLs: https://yourtenant.sharepoint.com/sites/[site-name]
  • The proxy enables development without exposing SharePoint credentials

Key Benefits

  • No API Translation: Direct proxy to SharePoint REST API ensures 100% compatibility
  • Multi-Site Support: Access any site in your tenant through one authenticated proxy
  • Zero Code Changes: Drop-in replacement for sp-rest-proxy
  • Modern Authentication: OAuth2 with automatic browser-based login
  • Full Feature Support: All SharePoint REST API features work without limitations

Files

  • sp-proxy-server.js - Main SharePoint REST API proxy server implementation