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

@onlinefreecv/google-image-picker

v1.1.7

Published

Google Drive Image Picker (React/Next.js) for OnlineFreeCV

Readme

🖼️ @onlinefreecv/google-image-picker

A lightweight Google Drive Image Picker for React and Next.js — built for the OnlineFreeCV ecosystem but usable in any project.

It lets users pick or upload images from their Google Drive, automatically sets them to public access, and returns stable URLs that can be used directly in <img> or <Image> tags.


🚀 Installation

pnpm add @onlinefreecv/google-image-picker
# or
npm install @onlinefreecv/google-image-picker
# or
yarn add @onlinefreecv/google-image-picker

⚙️ Google Cloud Setup

Go to Google Cloud Console → APIs & Services

Enable:

  • Google Picker API
  • Google Drive API

Create a Web OAuth Client ID:

Authorized JavaScript origins → add:

http://localhost:3000
https://yourdomain.com

Create an API key and restrict it:

  • Restrict usage to Google Picker API
  • Add the same web origins

Copy both:

  • Client ID
  • API Key

"use client";

import { GoogleImagePicker, PickedFile } from "@onlinefreecv/google-image-picker";

export default function ProfileImagePicker() {
  const handlePicked = (files: PickedFile[]) => {
    console.log("Picked files:", files);
    // Each file includes:
    // id, name, mimeType, thumbnailUrl, publicUrl
  };

  return (
    <GoogleImagePicker
      apiKey={process.env.NEXT_PUBLIC_GOOGLE_PICKER_API_KEY!}
      clientId={process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID!}
      scopes="https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.file"
      onPicked={handlePicked}
      photoSize={400} // custom image resolution
    >
      <button className="btn">Pick from Google Drive</button>
    </GoogleImagePicker>
  );
}

📸 Returned File Object

Each selected file returns the following fields:

| Field | Type | Description | | -------------- | -------- | ------------------------------------------------------------------------------------------ | | id | string | Google Drive File ID | | name | string | File name | | mimeType | string | MIME type (e.g. image/png) | | thumbnailUrl | string | Drive thumbnail (lightweight preview) | | publicUrl | string | Stable public image URL usable in <img> tags | | webViewLink | string | Google Drive viewer page (optional) | | displayUrl | string | Optimized image URL for embedding (from lh3.googleusercontent.com, respects photoSize) |

Example public image URL:

https://lh3.googleusercontent.com/d/<FILE_ID>=s<SIZE>

🧠 Notes

  • The package automatically ensures uploads go into an "OnlineFreeCV Public" folder with public read access.
  • Images are returned with shareable drive.google.com links (not flaky usercontent links).
  • Works fully client-side in Next.js (app directory) and React 18+.

🧱 Example with Next.js <Image />

In next.config.js, allow the required domains:

images: {
  remotePatterns: [
    { protocol: 'https', hostname: 'drive.google.com' },
    { protocol: 'https', hostname: 'lh3.googleusercontent.com' },
  ],
},

Then use:

<Image
  src={file.publicUrl!}
  width={200}
  height={200}
  alt="Profile Image"
  unoptimized
/>

👨‍💻 Developed & Maintained By

Developed by: Liaqat Saeed
Maintained by: OnlineFreeCV Team
Contact: [email protected]
License: MIT

would you like me to add a “Publishing Guide” section too (showing how you publish via GitHub Actions using pnpm publish --provenance)?