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

s3-react-video-stream

v1.0.1

Published

A React component (or hook) for streaming videos from Amazon S3

Readme

s3-react-video-stream

A React component for streaming videos from Amazon S3 in a Next.js environment.
This component uses environment variables on the client side, so be aware of potential security implications before exposing your AWS credentials in a public environment.


Features

  • Easy S3 Video Streaming – uses AWS SDK’s pre-signed URLs to deliver video files.
  • React Query Integration – handles loading and error states gracefully.
  • Customizable – pass in props for autoPlay, controls, muted, and more.

Installation

npm install s3-react-video-stream
# or
yarn add s3-react-video-stream

Environment Variables

To use this component, you need to expose your S3 credentials to the client (only recommended for publicly accessible, read-only buckets):

NEXT_PUBLIC_S3_REGION=region
NEXT_PUBLIC_S3_READ_ACCESS=your-access-key-id
NEXT_PUBLIC_S3_READ_SECRET=your-secret-access-key

⚠️ Do not use sensitive AWS credentials in a public or production client-side environment.


Usage in Next.js

Setup React Query

Ensure you have @tanstack/react-query set up in your app:

// pages/_app.tsx or app/layout.tsx (for Next.js App Router)
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

const queryClient = new QueryClient();

export default function App({ Component, pageProps }) {
  return (
    <QueryClientProvider client={queryClient}>
      <Component {...pageProps} />
    </QueryClientProvider>
  );
}

Use the Component

import { VideoPlayer } from "s3-react-video-stream";

export default function MyPage() {
  return (
    <VideoPlayer
      bucketName="your-s3-bucket-name"
      videoKey="path/to/video.mp4"
      autoPlay
      controls
      muted
      loop
      className="max-w-3xl"
    />
  );
}

Props

| Prop | Type | Default | Description | | ---------- | --------- | ------- | ----------------------------------- | | bucketName | string | — | Name of the S3 bucket | | videoKey | string | — | Key of the video file in the bucket | | className | string | "" | Tailwind or custom class styling | | autoPlay | boolean | false | Whether to autoplay the video | | controls | boolean | true | Whether to show video controls | | muted | boolean | false | Whether the video is muted | | loop | boolean | false | Whether to loop the video |


Security Considerations

This component uses credentials in a client-side environment. For public, read-only use cases (e.g. video courses, promo content), this is acceptable, but never expose sensitive write permissions or confidential data.


Contributing

Contributions, issues and feature requests are welcome!
Feel free to check the issues page or submit a PR.


License

MIT