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

notebooklm-sdk

v0.3.4

Published

TypeScript SDK for NotebookLM API.

Readme

npm version types license

Unofficial. This SDK reverse-engineers the NotebookLM internal API. It may break when Google updates their service. Not affiliated with Google.

TypeScript port of notebooklm-py.

Install

npm install notebooklm-sdk
# or
bun add notebooklm-sdk

Quickstart

# Run once to authenticate
npx notebooklm-sdk login
import { NotebookLMClient } from "notebooklm-sdk";

const client = await NotebookLMClient.connect(); // uses ~/.notebooklm/session.json

// Create a notebook and add a source
const { id } = await client.notebooks.create("My Research");
await client.sources.addUrl(id, "https://en.wikipedia.org/wiki/TypeScript");

// Generate a podcast and download it
const { artifactId } = await client.artifacts.createAudio(id, {
  format: "deep_dive",
});
const audio = await client.artifacts.waitUntilReady(id, artifactId);
const mp3 = await client.artifacts.downloadAudio(id, audio.id);

// Chat with the sources
const res = await client.chat.ask(id, "Summarize the key points.");
console.log(res.answer);

Use cases

  • Blog & content generation — research a topic, import sources, generate a briefing doc automatically
  • Content pipelines — ingest articles or reports, generate a podcast or briefing doc on a schedule
  • Research automation — run web research, import results, and query them via chat
  • Document Q&A bots — feed documents into a notebook and build a chat interface on top
  • Batch artifact generation — generate quizzes, flashcards, or study guides from a library of sources
  • Notebook management — create, organize, and share notebooks programmatically

Authentication

Login (recommended)

Install Playwright once:

bun add -d playwright
bunx playwright install chromium

Authenticate:

npx notebooklm-sdk login

Opens a real Chrome window for Google sign-in. Session is saved to ~/.notebooklm/session.json and auto-discovered on every connect() — no config needed.

npx notebooklm-sdk whoami  # verify session is valid

CI / Server

Pass cookies via environment variable:

NOTEBOOKLM_COOKIES="SID=...; HSID=..."
const client = await NotebookLMClient.connect({
  cookies: process.env.NOTEBOOKLM_COOKIES,
});

To get cookie values: open NotebookLM in Chrome → DevTools → Network → any request → copy the Cookie header.

API surface

| API | What it does | | ----------- | ------------------------------------------------------- | | notebooks | Create, rename, delete, list notebooks | | sources | Add URLs, text, files; wait for processing | | artifacts | Generate and download AI outputs (see below) | | chat | Ask questions, follow-up conversations | | research | Run web research, import results as sources | | notes | Create and manage saved notes | | sharing | Control public access and per-user permissions | | settings | Get/set output language |

Artifact types

| Artifact | Method | Output | | -------------- | -------------------- | ----------------- | | Audio Overview | createAudio() | Downloadable MP3 | | Video Overview | createVideo() | Downloadable MP4 | | Slide Deck | createSlideDeck() | PDF / PPTX download | | Infographic | createInfographic()| PNG download | | Mind Map | createMindMap() | JSON download | | Reports | createReport() | Markdown download | | Flashcards | createFlashcards() | Interactive HTML | | Quiz | createQuiz() | Interactive HTML | | Data Table | createDataTable() | CSV (headers + rows) |

Full API reference →

Examples

npx notebooklm-sdk login

bun run examples/basic.ts           # list notebooks and sources
bun run examples/chat.ts            # ask questions, follow-up conversations
bun run examples/audio.ts           # generate and download a podcast
bun run examples/video.ts           # generate and download a cinematic video
bun run examples/report.ts          # generate and download a briefing doc
bun run examples/slide-deck.ts      # generate and download PDF / PPTX
bun run examples/infographic.ts     # generate and download a PNG infographic
bun run examples/mind-map.ts        # generate and download mind map JSON
bun run examples/data-table.ts      # generate and download a CSV data table
bun run examples/notes.ts           # create, update, list, and delete notes
bun run examples/research.ts        # web research and import sources
bun run examples/research-and-chat.ts  # research → import → chat
bun run examples/full-lifecycle.ts  # create, add sources, chat, delete
bun run examples/download.ts        # download all completed artifacts

Requirements

  • Node.js 18+ or Bun 1.0+
  • A Google account with access to NotebookLM

Contributing

Issues and PRs welcome. If the API breaks after a Google update, please open an issue with the error and request/response details.

License

MIT