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

gawa.js

v1.0.17

Published

Gemini AI Web API

Readme

Gemini AI Wrapper API (JavaScript Version)

Gemini-API

A JavaScript implementation of the Gemini AI Wrapper API, providing Node.js modules. This project is a remake and direct translation of the original Python version available at HanaokaYuzu/Gemini-API which is currently mimic the v1.15.2 (latest) version of the gemini_webapi.

🚀 Features

  • Persistent Cookies - Automatically refreshes cookies in background. Optimized for always-on services (currently tested).
  • Image Generation - Natively supports generating and modifying images with natural language. (60% success)
  • System Prompt - Supports customizing model's system prompt with Gemini Gems.
  • Extension Support - (unimplemented yet)
  • Classified Outputs - Categorizes texts, thoughts, web images and AI generated images in the response.
  • Official Flavor - Provides a simple and elegant interface inspired by Google Generative AI's official API.

📋 Prerequisites

  • Node.js (v22+)
  • Cloudflare account with Wrangler CLI
  • Google Gemini cookies (for authentication)
  • Cloudflare D1 database (for token revocation)

🛠️ Installation

A. Install from NPM

npm i gawa.js

B. Clone from github

git clone https://github.com/RahadyanRizqy/GAWA.JS.git gawajs
cd gawajs

✨ Usage

Basic Setup

import { GeminiClient, setLogLevel } from 'gawa.js';

/*
By default setLogLevel is set to debug mode
you may change my

import { setLogLevel } from 'gawa.js';

setLogLevel('debug');
*/

const client = new GeminiClient({
    cookieHeader: 'your-cookie-header-here'
});

(async() => {
    await client.init();

    // execute here ...
})();

Generate Content

// Simple text generation
const response = await client.generateContent({ prompt: 'Hello' });
console.log(response.text);

// With files
const response = await client.generateContent({
    prompt: 'Explain this image',
    files: [path.resolve('./image.jpg')]
});
console.log(response.text);

Chat Conversations

const chat = client.startChat();
const response1 = await chat.sendMessage('What is the capital of Russia?');
console.log(response1.text);

const response2 = await chat.sendMessage('And what is the population?');
console.log(response2.text);

Using Different Models

const response = await client.generateContent({
    prompt: "What's your language model version?",
    model: 'gemini-2.5-flash'
});
console.log(response.text);

Creating Custom Gems

const newGem = await client.createGem(
    'Python Tutor',
    'You are a helpful Python programming tutor.',
    'A specialized gem for Python programming'
);

const response = await client.generateContent({
    prompt: 'Explain how list comprehensions work in Python',
    gem: newGem
});
console.log(response.text);

Handling Images

const response = await client.generateContent({
    prompt: 'Generate some pictures of cats'
});

for (const image of response.images) {
    await image.save({ path: 'temp/', filename: `cat.png` });
}

For more advanced usage, see test.js.

🔗 References

❗ Notes (Known Failures)

  • The autorefresh logging might shows error but it works perfectly
  • Express.js API (currently tested) integration works for more than 2 days
  • Discord.js (currently tested) integration fails to send/receive message after couple of hours, this might be due to cookie refreshment mechanism that isn't suitable for discord event-driven message (need external API like Express.js/Fastify)