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

@bucketmate/nextjs

v1.1.1

Published

Adapter package to wire BucketMate providers with Next.js (v15 App Router) and Next.js 16 App Router compatibility notes.

Downloads

5

Readme

@bucketmate/nextjs

Adapter package to wire BucketMate providers with Next.js (v15 App Router) and Next.js 16 App Router compatibility notes.

Features

  • Simple, typed API to configure multiple providers (r2, minio, do, s3)
  • Lightweight route handlers compatible with Next.js App Router
  • Publishable as an npm package

Install

  • Using npm
    • cd packages/nextjs
    • npm install
    • npm pack // optional to verify before publish
  • Using pnpm (workspace aware)
    • pnpm install (from repo root)

Build

  • pnpm -w run build (builds all workspace packages, including this one)

Usage (Next.js App Router)

This package exposes a small API to create a route handler that dispatches to the correct bucket provider based on the request path. Wire it into your Next.js app using App Router API routes. The API is compatible with both v15 and v16 App Router patterns.

Quick example (TypeScript)

// File: apps/nextjs-app/app/api/bucketmate/route.ts
import { createBucketmateNextHandler, toNextJsHandler } from '@bucketmate/nextjs';
import type { BucketClientConfig } from '@bucketmate/client';

const readEnv = (k: string, f?: string) => {
  const v = process.env[k];
  if (typeof v === 'string' && v.length) return v;
  if (f !== undefined) return f;
  throw new Error(`BucketmateNext: missing env ${k}`);
};

const cfg: BucketClientConfig = {
  provider: 'r2',
  endpoint: readEnv('R2_ENDPOINT'),
  region: readEnv('R2_REGION', 'auto'),
  bucket: readEnv('R2_BUCKET_NAME'),
  accessKeyId: readEnv('R2_ACCESS_KEY'),
  secretAccessKey: readEnv('R2_SECRET_KEY')
};

// wrap the handler for Next.js App Router and export method handlers
const handler = toNextJsHandler(createBucketmateNextHandler(cfg));

export const { GET, POST, DELETE } = handler;
  • The above demonstrates wiring for four providers. You can tailor the env vars or migrate to a config object from your own runtime.

Project structure (example)

  • apps/nextjs-app/
    • app/
      • api/
        • bucketmate/
          • route.ts
    • package.json

Environment variables (example)

  • R2_ENDPOINT, R2_REGION, R2_BUCKET_NAME, R2_ACCESS_KEY, R2_SECRET_KEY
  • MINIO_ENDPOINT, MINIO_REGION, MINIO_BUCKET_NAME, MINIO_ACCESS_KEY, MINIO_SECRET_KEY
  • DO_ENDPOINT, DO_REGION, DO_BUCKET_NAME, DO_ACCESS_KEY, DO_SECRET_KEY
  • AWS_S3_ENDPOINT, AWS_REGION, AWS_BUCKET, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY

Publishing

  • Build: pnpm -w run build
  • Publish (workspace aware):
    • pnpm -F @bucketmate/nextjs publish --access public
    • Or, cd into packages/nextjs and run npm publish --access public

Notes

  • This is designed for compatibility with Next.js App Router (v15) and aligns with Next.js v16 app router patterns where routes live under app/api. If you’re using a different routing strategy, adapt the handlers accordingly.
  • For actual bucket operations, replace the simple payload with real adapter calls to your BucketMate core.