Your one-stop solution for OneDrive and SharePoint file picking in React
This project is currently in alpha. While it's functional, expect breaking changes and evolving APIs. Production use is at your own discretion.
- 🔋 Batteries included with built-in MSAL authentication
- 🎯 Zero-config file picker integration
- 🎨 Modern React hooks-based API
- 🔄 TypeScript support out of the box
- 🛡️ Built-in error boundaries and retry mechanisms
- 🌐 SharePoint and OneDrive support
We welcome contributions! Whether it's:
🐛 Bug reports 💡 Feature suggestions 📝 Documentation improvements 🔧 Pull requests
Soon you'll be able to use our picker with hooks for more flexibility:
import { usePicker } from '@jjspscl/react-onedrive';
const MyComponent = () => {
const { open, isOpen, selectedFiles } = usePicker({
authOptions: {
clientId: "your-client-id",
authority: "https://login.microsoftonline.com/common"
},
pickerOptions: {
selection: { mode: "multiple" }
}
});
return (
<>
<button onClick={open}>
Pick Files
</button>
{isOpen && <div>Selecting files...</div>}
{selectedFiles?.map(file => (
<div key={file.id}>{file.name}</div>
))}
</>
);
};
MIT © jjspscl