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

@snapif/onedrive-filepicker

v0.1.4

Published

This project provides a React component for integrating the OneDrive/SharePoint file picker into your application. It uses the `@pnp/core` library to handle communication with the picker and `@azure/msal-browser` for authentication.

Readme

React File Picker

This project provides a React component for integrating the OneDrive/SharePoint file picker into your application. It uses the @pnp/core library to handle communication with the picker and @azure/msal-browser for authentication.

Getting Started

To get started with this project, you will need to have Node.js and npm installed on your machine. You can then install the project dependencies by running the following command in the project directory:

npm install

Running the Project

To run the project, you can use the following command:

npm run dev

This will start the development server and open the application in your default browser. You can then use the file picker component in your application.

Building the Project

To build the project for production, you can use the following command:

npm run build

This will create a production-ready build of the project in the dist directory.

Using the File Picker Component in Development

To use in development, you can use npm link:

# In this project directory
npm link

# In your project directory
npm link onedrive-filepicker

Using the File Picker Component in Production

You can add this project as follows:

npm install onedrive-filepicker

Inside your project, you need to replicate the example shown in src/App.tsx.

Publishing to NPM

  1. Bump the version in package.json (follow semver):

    npm version patch   # 0.0.3 → 0.0.4 (bug fixes)
    npm version minor   # 0.0.3 → 0.1.0 (new features)
    npm version major   # 0.0.3 → 1.0.0 (breaking changes)
  2. Build the package:

    npm run build
  3. Log in to npm (only needed once per machine):

    npm login
  4. Publish:

    npm publish --access public

The published package is available at https://www.npmjs.com/package/@snapif/onedrive-filepicker.

Registering with Microsoft

See: OneDrive File Picker Required Setup Docs

To use the file picker, you will need to register your application with Microsoft Azure.

  1. Go to the Microsoft Azure portal and sign in with a Microsoft account.

  2. Under Azure services, click on App registrations. App registraions button

  3. Click on the New registration to create a new registration. New registration button

  4. Register an application

    1. Provide an appropriate user-facing display name.
    2. Choose the accounts types that can use the application (select Any Entra ID Tenant + Personal Microsoft accounts for all OneDrive and SharePoint account).
    3. You can leave Redirect URI empty as it will be set in the next step.

    Register an application

  5. Register the application and then, under Manage > Authentication (Preview), set your redirect URIs that will be used during user login.

    1. Click the Add Redirect URI button.
    2. Select Single-page application
    3. Set the redirect URI. For the example in this repository, use https://localhost:5173. Ensure you also add your production redirect URL.
    4. Ensure both Access tokens and ID tokens are checked

    Add redirect URI

  6. Under Manage > API permissions, add the appropriate delegated permissions.

    1. Add the Microsoft Graph delegated permissions Files.Read.All and Sites.Read.All for read-only access or Files.ReadWrite.All and Sites.ReadWrite.All for read/write access. Make sure to leave User.Read for Graph delegated permissions
    2. Add the SharePoint delegated permissions AllSites.Read and MyFiles.Read for read-only access or AllSites.Write and MyFiles.Write for read/write access. Configured API permissions

Note: When connecting to OneDrive Personal, you will also need to request the OneDrive.ReadWrite scope, which corresponds to Files.ReadWrite.All or Files.ReadWrite.