{"id":36800551,"url":"https://github.com/photon-hq/notebooklm-kit","last_synced_at":"2026-01-12T13:33:48.305Z","repository":{"id":331576051,"uuid":"1122510188","full_name":"photon-hq/notebooklm-kit","owner":"photon-hq","description":"TypeScript SDK for programmatic access to Google NotebookLM","archived":false,"fork":false,"pushed_at":"2026-01-10T08:45:16.000Z","size":8046,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T01:42:51.636Z","etag":null,"topics":["gemini","google","notebooklm","tyepscript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/photon-hq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-24T22:35:15.000Z","updated_at":"2026-01-10T08:45:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/photon-hq/notebooklm-kit","commit_stats":null,"previous_names":["photon-hq/notebooklm-kit"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/photon-hq/notebooklm-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photon-hq%2Fnotebooklm-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photon-hq%2Fnotebooklm-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photon-hq%2Fnotebooklm-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photon-hq%2Fnotebooklm-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/photon-hq","download_url":"https://codeload.github.com/photon-hq/notebooklm-kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photon-hq%2Fnotebooklm-kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gemini","google","notebooklm","tyepscript"],"created_at":"2026-01-12T13:33:48.069Z","updated_at":"2026-01-12T13:33:48.253Z","avatar_url":"https://github.com/photon-hq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![Banner](./.github/asset/banner.png)\n   \n# notebooklm-kit\n\n\u003e A TypeScript SDK for programmatic access to Google NotebookLM.\n\n\u003c/div\u003e\n\n[![npm version](https://img.shields.io/npm/v/notebooklm-kit.svg)](https://www.npmjs.com/package/notebooklm-kit)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://www.typescriptlang.org/)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n[![Discord](https://img.shields.io/badge/Discord-Join-5865F2.svg?logo=discord\u0026logoColor=white)](https://discord.gg/bZd4CMd2H5)\n\n## Overview\n\nThe NotebookLM Kit provides a clean, service-based interface to all NotebookLM features. Perfect for building AI research assistants, study tools, content generators, and automated knowledge management systems.\n\n## Features\n\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eFeature\u003c/th\u003e\n\u003cth\u003eMethod\u003c/th\u003e\n\u003cth\u003eExample\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd colspan=\"3\" style=\"padding-top: 20px; padding-bottom: 20px;\"\u003e\u003cstrong style=\"font-size: 1.2em;\"\u003e\u003ca href=\"#notebooks\"\u003eNotebook Management\u003c/a\u003e\u003c/strong\u003e \u003csmall\u003e\u003ccode\u003elist()\u003c/code\u003e, \u003ccode\u003ecreate()\u003c/code\u003e, \u003ccode\u003eget()\u003c/code\u003e, \u003ccode\u003eupdate()\u003c/code\u003e, \u003ccode\u003edelete()\u003c/code\u003e, \u003ccode\u003eshare()\u003c/code\u003e\u003c/small\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eList Notebooks\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notebooks.list()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/notebook-list.ts\"\u003enotebook-list.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCreate Notebook\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notebooks.create()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/notebook-create.ts\"\u003enotebook-create.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGet Notebook\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notebooks.get()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/notebook-get.ts\"\u003enotebook-get.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eUpdate Notebook\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notebooks.update()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/notebook-update.ts\"\u003enotebook-update.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDelete Notebook\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notebooks.delete()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/notebook-delete.ts\"\u003enotebook-delete.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eShare Notebook \u003csmall\u003e⚠️ Experimental\u003c/small\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notebooks.share()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/notebook-share.ts\"\u003enotebook-share.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd colspan=\"3\" style=\"padding-top: 20px; padding-bottom: 20px;\"\u003e\u003cstrong style=\"font-size: 1.2em;\"\u003e\u003ca href=\"#sources\"\u003eSource Management\u003c/a\u003e\u003c/strong\u003e \u003csmall\u003e\u003ccode\u003elist()\u003c/code\u003e, \u003ccode\u003eget()\u003c/code\u003e, \u003ccode\u003eadd.url()\u003c/code\u003e, \u003ccode\u003eadd.text()\u003c/code\u003e, \u003ccode\u003eadd.youtube()\u003c/code\u003e, \u003ccode\u003eadd.file()\u003c/code\u003e, \u003ccode\u003eadd.drive()\u003c/code\u003e, \u003ccode\u003eadd.batch()\u003c/code\u003e, \u003ccode\u003eadd.web.searchAndWait()\u003c/code\u003e, \u003ccode\u003eupdate()\u003c/code\u003e, \u003ccode\u003edelete()\u003c/code\u003e, \u003ccode\u003estatus()\u003c/code\u003e\u003c/small\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eList Sources\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.list()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-list.ts\"\u003esource-list.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAdd URL Source\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.add.url()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-add-url.ts\"\u003esource-add-url.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAdd Text Source\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.add.text()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-add-text.ts\"\u003esource-add-text.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAdd YouTube Source\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.add.youtube()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-add-youtube.ts\"\u003esource-add-youtube.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAdd File Source\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.add.file()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-add-file.ts\"\u003esource-add-file.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAdd Drive Source \u003csmall\u003e⚠️ Experimental\u003c/small\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.add.drive()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-add-drive.ts\"\u003esource-add-drive.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAdd Batch Sources\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.add.batch()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-add-batch.ts\"\u003esource-add-batch.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eWeb Search Source\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.add.web.searchAndWait()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-web-search.ts\"\u003esource-web-search.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAdvanced Web Search\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.add.web.searchAndWait()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-web-search-advanced.ts\"\u003esource-web-search-advanced.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGet Source\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.get()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-get.ts\"\u003esource-get.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eUpdate Source\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.update()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-update.ts\"\u003esource-update.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDelete Source\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.delete()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-delete.ts\"\u003esource-delete.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCheck Source Status\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.sources.status()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/source-status.ts\"\u003esource-status.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd colspan=\"3\" style=\"padding-top: 20px; padding-bottom: 20px;\"\u003e\u003cstrong style=\"font-size: 1.2em;\"\u003e\u003ca href=\"#artifacts\"\u003eArtifact Generation\u003c/a\u003e\u003c/strong\u003e \u003csmall\u003e\u003ccode\u003ecreate()\u003c/code\u003e, \u003ccode\u003elist()\u003c/code\u003e, \u003ccode\u003eget()\u003c/code\u003e, \u003ccode\u003edownload()\u003c/code\u003e, \u003ccode\u003erename()\u003c/code\u003e, \u003ccode\u003edelete()\u003c/code\u003e, \u003ccode\u003eshare()\u003c/code\u003e\u003c/small\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCreate Artifact\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.create()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/artifact-create.ts\"\u003eartifact-create.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCreate Artifact (Subservices)\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.{type}.create()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/artifact-create-subservices.ts\"\u003eartifact-create-subservices.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eList Artifacts\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.list()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/artifact-list.ts\"\u003eartifact-list.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGet Artifact\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.get()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/artifact-get.ts\"\u003eartifact-get.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDownload Artifact\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.download()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/artifact-download.ts\"\u003eartifact-download.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDownload Video\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.download()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/artifact-video.ts\"\u003eartifact-video.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDownload Slides\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.download()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/slide-download-test.ts\"\u003eslide-download-test.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eRename Artifact\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.rename()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/artifact-rename.ts\"\u003eartifact-rename.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDelete Artifact\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.delete()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/artifact-delete.ts\"\u003eartifact-delete.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eShare Artifact\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.artifacts.share()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/artifact-share.ts\"\u003eartifact-share.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd colspan=\"3\" style=\"padding-top: 20px; padding-bottom: 20px;\"\u003e\u003cstrong style=\"font-size: 1.2em;\"\u003e\u003ca href=\"#generation--chat\"\u003eChat \u0026 Generation\u003c/a\u003e\u003c/strong\u003e \u003csmall\u003e\u003ccode\u003echat()\u003c/code\u003e, \u003ccode\u003echatStream()\u003c/code\u003e, \u003ccode\u003esetChatConfig()\u003c/code\u003e\u003c/small\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eChat\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.generation.chat()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/chat-basic.ts\"\u003echat-basic.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eStream Chat\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.generation.chatStream()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/chat-conversation.ts\"\u003echat-conversation.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eSet Chat Config\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.generation.setChatConfig()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/generation-set-chat-config.ts\"\u003egeneration-set-chat-config.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd colspan=\"3\" style=\"padding-top: 20px; padding-bottom: 20px;\"\u003e\u003cstrong style=\"font-size: 1.2em;\"\u003e\u003ca href=\"#notes\"\u003eNotes Management\u003c/a\u003e\u003c/strong\u003e \u003csmall\u003e\u003ccode\u003elist()\u003c/code\u003e, \u003ccode\u003ecreate()\u003c/code\u003e, \u003ccode\u003eupdate()\u003c/code\u003e, \u003ccode\u003edelete()\u003c/code\u003e\u003c/small\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr style=\"height: 30px;\"\u003e\u003ctd colspan=\"3\"\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eList Notes\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notes.list()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/note-list.ts\"\u003enote-list.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCreate Note\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notes.create()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/note-create.ts\"\u003enote-create.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eUpdate Note\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notes.update()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/note-update.ts\"\u003enote-update.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDelete Note\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003esdk.notes.delete()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ca href=\"examples/note-delete.ts\"\u003enote-delete.ts\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n## Installation\n\n```bash\nnpm install notebooklm-kit\n```\n\n**From source:**\n```bash\ngit clone https://github.com/photon-hq/notebooklm-kit.git \u0026\u0026 cd notebooklm-kit \u0026\u0026 npm run setup\n```\n\n**Requirements:** Node.js \u003e=18.0.0\n\n## Version\n\nCurrent version: **2.1.1**\n\n## Available Scripts\n\nWhen working with the repository, you can use the following npm scripts:\n\n| Script | Description |\n|--------|-------------|\n| `npm install` | Install dependencies and automatically build (runs postinstall) |\n| `npm run setup` | Full setup: install dependencies, Playwright, and build |\n| `npm run build` | Compile TypeScript to JavaScript |\n| `npm run build:dev` | Build only (no reinstall) |\n| `npm run dev` | Watch mode (auto-rebuild on file changes) |\n| `npm run clean` | Remove compiled dist/ directory |\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDevelopment\u003c/strong\u003e\u003c/summary\u003e\n\n**First-time setup:**\n```bash\nnpm run setup\n```\n\n**Build only (no reinstall):**\n```bash\nnpm run build:dev\n```\n\n**Watch mode (auto-rebuild):**\n```bash\nnpm run dev\n```\n\n**Clean build:**\n```bash\nnpm run clean \u0026\u0026 npm run build\n```\n\n\u003c/details\u003e\n\n## Quick Start\n\n### 1. Install the package\n\n```bash\nnpm install notebooklm-kit\n```\n\n### 2. Set up authentication\n\n**Auto (browser):** Create `.env` with `GOOGLE_EMAIL` and `GOOGLE_PASSWORD` (no 2FA required)\n\n**Manual:** Create `.env` with `NOTEBOOKLM_AUTH_TOKEN` and `NOTEBOOKLM_COOKIES` from browser DevTools (Network → Cookie header, Console → `window.WIZ_global_data.SNlM0e`)\n\n### 3. Use the SDK\n\n```typescript\nimport { NotebookLMClient } from 'notebooklm-kit';\nimport dotenv from 'dotenv';\n\n// Load .env file from project root (automatically detected)\ndotenv.config();\n\nasync function main() {\n  const sdk = new NotebookLMClient({\n    // Credentials are automatically loaded from .env file\n    // Priority: NOTEBOOKLM_AUTH_TOKEN/NOTEBOOKLM_COOKIES \u003e GOOGLE_EMAIL/GOOGLE_PASSWORD\n  });\n\n  try {\n    await sdk.connect();\n\n    // List notebooks\n    const notebooks = await sdk.notebooks.list();\n    console.log(`Found ${notebooks.length} notebooks`);\n\n    // Create a notebook\n    const notebook = await sdk.notebooks.create({\n      title: 'My Research',\n      emoji: '📚',\n    });\n    console.log(`Created: ${notebook.title}`);\n\n  } catch (error) {\n    console.error('Error:', error);\n  } finally {\n    sdk.dispose();\n  }\n}\n\nmain();\n```\n\n**Note:** The SDK automatically loads credentials from environment variables. See [SDK Initialization](#sdk-initialization) for all configuration options.\n\n### Running Examples\n\nThe repository includes working examples in the [`examples/`](examples/) directory. To run them:\n\n1. **Set up your `.env` file** in the project root (see [Authentication](#2-set-up-authentication) above)\n2. **Run any example** using `tsx`:\n   ```bash\n   npx tsx examples/notebook-list.ts\n   npx tsx examples/chat-basic.ts\n   ```\n\n**Chat Example Usage:**\n```bash\n# Interactive mode (prompts for notebook and message)\nnpx tsx examples/chat-basic.ts\n\n# With notebook ID and message (streaming mode - default)\nnpx tsx examples/chat-basic.ts \u003cnotebook-id\u003e \"What are the key findings?\"\n\n# Non-streaming mode (get complete response at once)\nnpx tsx examples/chat-basic.ts \u003cnotebook-id\u003e \"What are the key findings?\" --no-stream\n```\n\n**Note:** The examples automatically detect and load the `.env` file from the project root, regardless of where you run them from.\n\n## Features\n\n### `sdk.notebooks` - Notebook Management\n\n| Feature | Description | Method | Example |\n|---------|-------------|--------|---------|\n| List Notebooks | List all your notebooks (recently viewed) | [`sdk.notebooks.list()`](#list-notebooks) | [notebook-list.ts](examples/notebook-list.ts) |\n| Get Notebook | Get full details of a specific notebook | [`sdk.notebooks.get(notebookId)`](#get-notebook) | [notebook-get.ts](examples/notebook-get.ts) |\n| Create Notebook | Create a new notebook (auto-generates title if empty) | [`sdk.notebooks.create(options)`](#create-notebook) | [notebook-create.ts](examples/notebook-create.ts) |\n| Update Notebook | Update notebook title or emoji | [`sdk.notebooks.update(notebookId, options)`](#update-notebook) | [notebook-update.ts](examples/notebook-update.ts) |\n| Delete Notebook | Delete one or more notebooks | [`sdk.notebooks.delete(notebookIds)`](#delete-notebook) | [notebook-delete.ts](examples/notebook-delete.ts) |\n| Share Notebook \u003csmall\u003e⚠️ Experimental\u003c/small\u003e | Share notebook with users or enable link sharing | [`sdk.notebooks.share(notebookId, options)`](#share-notebook) | [notebook-share.ts](examples/notebook-share.ts) |\n\n### `sdk.sources` - Source Management\n\n| Feature | Description | Method | Example |\n|---------|-------------|--------|---------|\n| List Sources | List all sources in a notebook | [`sdk.sources.list(notebookId)`](#list-sources) | [source-list.ts](examples/source-list.ts) |\n| Get Source | Get one or all sources | [`sdk.sources.get(notebookId, sourceId?)`](#get-source) | [source-get.ts](examples/source-get.ts) |\n| Add URL | Add a source from a web page URL | [`sdk.sources.add.url(notebookId, options)`](#add-url-source) | [source-add-url.ts](examples/source-add-url.ts) |\n| Add Text | Add a source from text content | [`sdk.sources.add.text(notebookId, options)`](#add-text-source) | [source-add-text.ts](examples/source-add-text.ts) |\n| Add File | Add a source from a file (PDF, image, etc.) | [`sdk.sources.add.file(notebookId, options)`](#add-file-source) | [source-add-file.ts](examples/source-add-file.ts) |\n| Add YouTube | Add a YouTube video as a source | [`sdk.sources.add.youtube(notebookId, options)`](#add-youtube-source) | [source-add-youtube.ts](examples/source-add-youtube.ts) |\n| Add Google Drive \u003csmall\u003e⚠️ Experimental\u003c/small\u003e | Add a Google Drive file as a source | [`sdk.sources.add.drive(notebookId, options)`](#add-google-drive-source) | [source-add-drive.ts](examples/source-add-drive.ts) |\n| Batch Add | Add multiple sources at once | [`sdk.sources.add.batch(notebookId, options)`](#batch-add-sources) | [source-add-batch.ts](examples/source-add-batch.ts) |\n| Web Search (Simple) | Search web and wait for results | [`sdk.sources.add.web.searchAndWait(notebookId, options)`](#web-search-simple) | [source-web-search.ts](examples/source-web-search.ts) |\n| Web Search (Advanced) | Multi-step web search workflow | [`sdk.sources.add.web.search()`](#web-search-advanced) → `getResults()` → `addDiscovered()` | [source-web-search-advanced.ts](examples/source-web-search-advanced.ts) |\n| Update Source | Update source metadata | [`sdk.sources.update(notebookId, sourceId, updates)`](#update-source) | [source-update.ts](examples/source-update.ts) |\n| Delete Source | Delete a source from a notebook | [`sdk.sources.delete(notebookId, sourceId)`](#delete-source) | [source-delete.ts](examples/source-delete.ts) |\n| Check Status | Check source processing status | [`sdk.sources.status(notebookId)`](#check-processing-status) | [source-status.ts](examples/source-status.ts) |\n\n### `sdk.artifacts` - Artifact Management\n\n| Feature | Description | Method | Example |\n|---------|-------------|--------|---------|\n| Create Artifact | Create study material (quiz, flashcards, mind map, etc.) | [`sdk.artifacts.create()`](#create-artifact) or `sdk.artifacts.{type}.create()` | [artifact-create.ts](examples/artifact-create.ts)\u003cbr\u003e[artifact-create-subservices.ts](examples/artifact-create-subservices.ts) |\n| List Artifacts | List all artifacts in a notebook (with filtering) | [`sdk.artifacts.list()`](#list-artifacts) | [artifact-list.ts](examples/artifact-list.ts) |\n| Get Artifact | Get artifact details (auto-fetches content when ready) | [`sdk.artifacts.get()`](#get-artifact) | [artifact-get.ts](examples/artifact-get.ts) |\n| Download Artifact | Download artifact data to disk (quiz/flashcard JSON, audio file) | [`sdk.artifacts.download()`](#download-artifact) | [artifact-download.ts](examples/artifact-download.ts) |\n| Download Video | Download video artifact as MP4 file | [`sdk.artifacts.download()`](#download-artifact) | [artifact-video.ts](examples/artifact-video.ts) |\n| Download Slides | Download slide deck as PDF or PNG files | [`sdk.artifacts.download()`](#download-artifact) | [slide-download-test.ts](examples/slide-download-test.ts) |\n| Rename Artifact | Rename an artifact | [`sdk.artifacts.rename()`](#rename-artifact) | [artifact-rename.ts](examples/artifact-rename.ts) |\n| Delete Artifact | Delete an artifact | [`sdk.artifacts.delete()`](#delete-artifact) | [artifact-delete.ts](examples/artifact-delete.ts) |\n| Share Artifact | Share artifact/notebook with users or enable link sharing | [`sdk.artifacts.share()`](#share-artifact) | [artifact-share.ts](examples/artifact-share.ts) |\n\n### `sdk.generation` - Generation \u0026 Chat\n\n| Feature | Description | Method | Example |\n|---------|-------------|--------|---------|\n| Chat (Non-streaming) | Chat with notebook content - returns complete response | [`sdk.generation.chat(notebookId, prompt, options?)`](#chat) | [chat-basic.ts](examples/chat-basic.ts) |\n| Chat Stream | Chat with real-time streaming response chunks | [`sdk.generation.chatStream(notebookId, prompt, options?)`](#chat-stream) | [chat-basic.ts](examples/chat-basic.ts) |\n| Chat Conversation | Multi-turn conversations with history tracking | [`sdk.generation.chat(notebookId, prompt, { conversationHistory })`](#chat) | [chat-conversation.ts](examples/chat-conversation.ts) |\n| Set Chat Config | Configure chat (custom prompt, learning guide, response length) | [`sdk.generation.setChatConfig(notebookId, config)`](#set-chat-configuration) | [generation-set-chat-config.ts](examples/generation-set-chat-config.ts) |\n\n### `sdk.notes` - Notes Management\n\n| Feature | Description | Method | Example |\n|---------|-------------|--------|---------|\n| List Notes | List all notes in a notebook | [`sdk.notes.list(notebookId)`](#list-notes) | [note-list.ts](examples/note-list.ts) |\n| Create Note | Create a new note | [`sdk.notes.create(notebookId, options)`](#create-note) | [note-create.ts](examples/note-create.ts) |\n| Update Note | Update a note | [`sdk.notes.update(notebookId, noteId, options)`](#update-note) | [note-update.ts](examples/note-update.ts) |\n| Delete Note | Delete a note | [`sdk.notes.delete(notebookId, noteIds)`](#delete-note) | [note-delete.ts](examples/note-delete.ts) |\n\n## Core Concepts\n\n### SDK Initialization\n\n**Methods:** `sdk.connect()` | `sdk.dispose()`\n\n**Basic Usage:**\n```typescript\nimport { NotebookLMClient } from 'notebooklm-kit';\nimport dotenv from 'dotenv';\n\ndotenv.config(); // Load .env from project root\n\nconst sdk = new NotebookLMClient({\n  // Credentials loaded automatically from environment variables:\n  // NOTEBOOKLM_AUTH_TOKEN, NOTEBOOKLM_COOKIES\n  // or GOOGLE_EMAIL, GOOGLE_PASSWORD\n});\n\ntry {\n  await sdk.connect(); // Initialize SDK, authenticate, start auto-refresh\n  \n  // Now you can use sdk.notebooks, sdk.sources, etc.\n  const notebooks = await sdk.notebooks.list();\n  \n} finally {\n  sdk.dispose(); // Always cleanup\n}\n```\n\n**Explicit Credentials:**\n```typescript\nconst sdk = new NotebookLMClient({\n  authToken: process.env.NOTEBOOKLM_AUTH_TOKEN!,\n  cookies: process.env.NOTEBOOKLM_COOKIES!,\n  // or\n  auth: {\n    email: process.env.GOOGLE_EMAIL!,\n    password: process.env.GOOGLE_PASSWORD!,\n  },\n});\n\nawait sdk.connect();\n```\n\n**Enable Debug Mode:**\n\nDebug mode provides detailed logging for troubleshooting, API calls, authentication, and internal operations.\n\n**Option 1: Environment Variable (Recommended)**\n```bash\n# In your .env file\nNOTEBOOKLM_DEBUG=true\n```\n\n**Option 2: Config Option**\n```typescript\nconst sdk = new NotebookLMClient({\n  debug: true, // Enable debug logging\n  // ... other config\n});\n\nawait sdk.connect();\n```\n\n**Option 3: Development Mode**\n```bash\n# Automatically enables debug in development\nNODE_ENV=development\n```\n\n**What Debug Mode Logs:**\n- ✅ RPC call details (method names, arguments, responses)\n- ✅ Authentication flow (login steps, credential extraction)\n- ✅ Auto-refresh operations (token refresh attempts, timing)\n- ✅ Streaming responses (chunk processing, parsing)\n- ✅ Error details (full stack traces, API responses)\n- ✅ Response parsing (chunked data processing, validation)\n\n**Example Debug Output:**\n```\n[DEBUG] RPC Call: wXbhsf with args: [null, 1, null, [2]]\n[DEBUG] Response received: 200 OK\n[DEBUG] Parsing chunked response: 3 chunks found\n[DEBUG] Auto-refresh: Token expires in 5 minutes, refreshing now...\n[DEBUG] Authentication: Extracting credentials from browser...\n```\n\n**Disable Debug:**\n```typescript\n// Explicitly disable (overrides environment variable)\nconst sdk = new NotebookLMClient({\n  debug: false,\n});\n```\n\n```bash\n# Or in .env\nNOTEBOOKLM_DEBUG=false\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eConnection Flow\u003c/strong\u003e\u003c/summary\u003e\n\n1. **Credentials Resolution** (in priority order):\n   - Provided in config (`authToken`/`cookies`)\n   - Environment variables (`NOTEBOOKLM_AUTH_TOKEN`/`NOTEBOOKLM_COOKIES`)\n   - Saved credentials (`credentials.json` in project root) - **reused automatically**\n   - Auto-login (if `auth.email`/`auth.password` provided) - **only if no saved credentials**\n   \n   **Note:** Set `FORCE_REAUTH=true` in `.env` to force re-authentication and ignore saved credentials\n\n2. **Initialization:**\n   - Creates RPC client with credentials\n   - Initializes all services (`notebooks`, `sources`, `artifacts`, etc.)\n   - Starts auto-refresh manager (if enabled)\n\n3. **Auto-Refresh:**\n   - Begins automatically after `connect()`\n   - Runs in background, doesn't block operations\n   - Updates credentials and cookies automatically\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCleanup\u003c/strong\u003e\u003c/summary\u003e\n\n**Always call `dispose()` when done:**\n- Stops auto-refresh background timers\n- Prevents memory leaks\n- Resets client state\n- Required for graceful shutdown\n\n```typescript\ntry {\n  await sdk.connect();\n  // ... use SDK ...\n} finally {\n  await sdk.dispose(); // Always cleanup\n}\n```\n\n\u003c/details\u003e\n\n### Authentication Overview\n\nAuthentication is handled automatically when you call `sdk.connect()`. Credentials are resolved in this priority order:\n\n1. Provided in config (`authToken`/`cookies`)\n2. Environment variables (`NOTEBOOKLM_AUTH_TOKEN`/`NOTEBOOKLM_COOKIES`)\n3. Saved credentials (`credentials.json` in project root)\n4. Auto-login (if `auth.email`/`auth.password` provided)\n\nSee the [Authentication](#authentication) section for detailed setup instructions and all configuration options.\n\n### Quota Limits\n\nReference: [Official Documentation](https://support.google.com/notebooklm/answer/16213268)\n\n**Plan Types:** `standard` (default) | `plus` | `pro` | `ultra`\n\n| Limit | Standard | Plus | Pro | Ultra |\n|-------|----------|------|-----|-------|\n| **Notebooks** | 100/user | 200/user | 500/user | 500/user |\n| **Sources/Notebook** | 50 | 100 | 300 | 600 |\n| **Words/Source** | 500,000 | 500,000 | 500,000 | 500,000 |\n| **File Size** | 200MB | 200MB | 200MB | 200MB |\n| **Chats/Day** | 50 | 200 | 500 | 5,000 |\n| **Audio/Video/Day** | 3 | 6 | 20 | 200 |\n| **Reports/Day** | 10 | 20 | 100 | 1,000 |\n| **Deep Research/Month** | 10 | 90 | 600 | 6,000 |\n| **Mind Maps** | Unlimited | Unlimited | Unlimited | Unlimited |\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eImportant Notes\u003c/strong\u003e\u003c/summary\u003e\n\n- **Daily quotas** reset after 24 hours\n- **Monthly quotas** reset after 30 days\n- **Word/File Limits:** NotebookLM rejects sources \u003e500k words or \u003e200MB. Copy-protected PDFs cannot be imported.\n- **Server-Side Enforcement:** Data Tables, Infographics, Slides (limits vary)\n- **Client-Side Validation:** Optional (`enforceQuotas: true`), disabled by default\n- **Plan Selection:** Set during SDK initialization: `plan: 'pro'`\n\n\u003c/details\u003e\n\n## Authentication\n\n### Auto-Login (Recommended)\n\n**Method:** Use `auth` config with email/password\n\n```typescript\nconst sdk = new NotebookLMClient({\n  auth: {\n    email: process.env.GOOGLE_EMAIL,\n    password: process.env.GOOGLE_PASSWORD,\n    headless: true, // default: true\n  },\n});\n\nawait sdk.connect(); // Logs in, extracts auth token, prompts for cookies, saves to credentials.json\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eEnvironment Variables (.env file)\u003c/strong\u003e\u003c/summary\u003e\n\n**File Location:** Create `.env` in your **project root** directory (same directory as `package.json`).\n\n```bash\n# .env file location: /path/to/your-project/.env\n\n# Option 1: Auto-login with email/password (recommended - requires no 2FA)\nGOOGLE_EMAIL=\"your-email@gmail.com\"\nGOOGLE_PASSWORD=\"your-password\"\n\n# Option 2: Manual credentials (for production or when auto-login isn't available)\nNOTEBOOKLM_AUTH_TOKEN=\"ACi2F2NZSD7yrNvFMrCkP3vZJY1R:1766720233448\"\nNOTEBOOKLM_COOKIES=\"_ga=GA1.1.1949425436.1764104083; SID=g.a0005AiwX...; ...\"\n\n# Optional: Retry configuration\nNOTEBOOKLM_MAX_RETRIES=1          # Default: 1\nNOTEBOOKLM_RETRY_DELAY=1000       # Default: 1000ms\nNOTEBOOKLM_RETRY_MAX_DELAY=5000   # Default: 5000ms\n\n# Optional: Debug mode (enables detailed logging)\nNOTEBOOKLM_DEBUG=true             # Enable debug logging for troubleshooting\n\n# Optional: Force re-authentication (ignore saved credentials)\nFORCE_REAUTH=true\n```\n\n**Important:**\n- `.env` file must be in the **project root** (not in subdirectories)\n- Account must NOT have 2FA enabled (or use app-specific passwords)\n- The `.env` file is automatically ignored by git (see `.gitignore`)\n\n\u003c/details\u003e\n\n### Manual Credentials\n\n**Method:** Provide `authToken` and `cookies` directly\n\n```typescript\nconst sdk = new NotebookLMClient({\n  authToken: process.env.NOTEBOOKLM_AUTH_TOKEN!,\n  cookies: process.env.NOTEBOOKLM_COOKIES!,\n  enforceQuotas: true, // optional\n  plan: 'standard', // optional: 'standard' | 'plus' | 'pro' | 'ultra'\n});\n\nawait sdk.connect();\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eGetting Credentials\u003c/strong\u003e\u003c/summary\u003e\n\n1. **Auth Token**: Open https://notebooklm.google.com → DevTools (F12) → Console → Run: `window.WIZ_global_data.SNlM0e`\n2. **Cookies**: DevTools → Network tab → Any request → Headers → Copy Cookie value\n\n\u003c/details\u003e\n\n### Saved Credentials\n\n**Location:** `credentials.json` in project root (e.g., `notebooklm-kit/credentials.json`)\n\nWhen using auto-login with email/password:\n1. Browser opens and authenticates\n2. Auth token is extracted automatically\n3. You're prompted to manually paste cookies\n4. Credentials are saved to `credentials.json` for future use\n\n**Subsequent runs:**\n- Saved credentials are automatically reused (no browser prompt)\n- Faster startup - no need to re-enter cookies\n- Credentials file is in project root for easy viewing/editing\n\n**To force re-authentication:**\n- Set `FORCE_REAUTH=true` in `.env`, or\n- Delete `credentials.json` file\n\n**Security Note:** `credentials.json` contains sensitive authentication data. It's automatically added to `.gitignore` to prevent accidental commits.\n\n### Auto-Refresh Configuration\n\n**Default:** Enabled with `'auto'` strategy (recommended)\n\n```typescriptimproved\n// Default: auto strategy (expiration-based + time-based fallback)\nconst sdk = new NotebookLMClient({\n  auth: { email: '...', password: '...' },\n  // autoRefresh: true (default)\n});\n\n// Time-based (simple, predictable)\nautoRefresh: { strategy: 'time', interval: 10 * 60 * 1000 }\n\n// Expiration-based (maximum efficiency)\nautoRefresh: { strategy: 'expiration', refreshAhead: 5 * 60 * 1000 }\n\n// Disable\nautoRefresh: false\n\n// Manual refresh\nawait sdk.refreshCredentials();\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eAuto-Refresh Details\u003c/strong\u003e\u003c/summary\u003e\n\n- Credentials updated automatically after refresh\n- Cookies kept in sync\n- Runs in background, doesn't block operations\n- See [Auto-Refresh Strategies](#auto-refresh-strategies) in Core Concepts\n\n\u003c/details\u003e\n\n### Quota Management\n\n**Method:** `sdk.getUsage()` | `sdk.getRemaining()` | `sdk.getQuotaManager()`\n\n```typescript\nconst sdk = new NotebookLMClient({\n  auth: { email: '...', password: '...' },\n  enforceQuotas: true, // Enable client-side validation (disabled by default)\n  plan: 'pro', // Set plan for accurate limits\n});\n\nawait sdk.connect();\n\n// Check usage\nconst usage = sdk.getUsage();\nconst remaining = sdk.getRemaining('chats');\nconst limits = sdk.getQuotaManager().getLimits();\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eQuota Notes\u003c/strong\u003e\u003c/summary\u003e\n\n- **Disabled by default** - enable with `enforceQuotas: true`\n- Throws `RateLimitError` if limit exceeded (when enabled)\n- Server-side enforcement always active (even if client-side disabled)\n- See [Quota Limits](#quota-limits) table in Core Concepts\n\n\u003c/details\u003e\n\n## Notebooks\n\nExamples: [notebook-list.ts](examples/notebook-list.ts) | [notebook-get.ts](examples/notebook-get.ts) | [notebook-create.ts](examples/notebook-create.ts) | [notebook-update.ts](examples/notebook-update.ts) | [notebook-delete.ts](examples/notebook-delete.ts) | [notebook-share.ts](examples/notebook-share.ts)\n\n### List Notebooks\n\n**Method:** `sdk.notebooks.list()`\n\n**Example:** [notebook-list.ts](examples/notebook-list.ts)\n\n**Returns:** `Promise\u003cNotebook[]\u003e`\n\n**Description:**\nLists all your notebooks (recently viewed). Returns a lightweight array of notebooks with essential information for display/selection.\n\n**Return Fields:**\n- `projectId: string` - Unique notebook ID (required for other operations)\n- `title: string` - Notebook title\n- `emoji: string` - Visual identifier\n- `sourceCount: number` - Number of sources in the notebook\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Automatically filters out system notebooks (e.g., \"OpenStax's Biology\")\n- Returns only notebooks you've recently viewed\n- Does not include full notebook details (use `get()` for that)\n- Does not include sources array (use `sources` service for source operations)\n- Does not include sharing info (use `get()` for sharing details)\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\nconst notebooks = await sdk.notebooks.list()\nconsole.log(`Found ${notebooks.length} notebooks`)\nnotebooks.forEach(nb =\u003e {\n  console.log(`${nb.emoji} ${nb.title} (${nb.sourceCount} sources)`)\n})\n```\n\n---\n\n### Get Notebook\n\n**Method:** `sdk.notebooks.get(notebookId)`\n\n**Example:** [notebook-get.ts](examples/notebook-get.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n\n**Returns:** `Promise\u003cNotebook\u003e`\n\n**Description:**\nRetrieves full details of a specific notebook, including analytics and sharing information. Makes parallel RPC calls to get complete notebook data.\n\n**Return Fields:**\n- `projectId: string` - Unique notebook ID\n- `title: string` - Notebook title\n- `emoji: string` - Visual identifier\n- `sourceCount?: number` - Number of sources (analytics)\n- `lastAccessed?: string` - Last accessed timestamp (ISO format, analytics)\n- `sharing?: SharingSettings` - Sharing configuration:\n  - `isShared: boolean` - Whether notebook is shared\n  - `shareUrl?: string` - Share URL if shared\n  - `shareId?: string` - Share ID\n  - `publicAccess?: boolean` - Whether public access is enabled\n  - `allowedUsers?: string[]` - Array of user emails with access\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Validates notebook ID format before making RPC calls\n- Calls both `RPC_GET_PROJECT` and `RPC_GET_SHARING_DETAILS` in parallel for efficiency\n- Sharing data is optional - won't fail if unavailable\n- Does not include sources array (use `sources` service for source operations)\n- `lastAccessed` is extracted from notebook metadata if available\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\nconst notebook = await sdk.notebooks.get('notebook-id')\nconsole.log(`Title: ${notebook.title}`)\nconsole.log(`Sources: ${notebook.sourceCount || 0}`)\nconsole.log(`Last accessed: ${notebook.lastAccessed || 'Never'}`)\nif (notebook.sharing?.isShared) {\n  console.log(`Share URL: ${notebook.sharing.shareUrl}`)\n}\n```\n\n---\n\n### Create Notebook\n\n**Method:** `sdk.notebooks.create(options)`\n\n**Example:** [notebook-create.ts](examples/notebook-create.ts)\n\n**Parameters:**\n- `options: CreateNotebookOptions`\n  - `title: string` - Notebook title (optional, auto-generated if empty)\n  - `emoji?: string` - Notebook emoji (optional)\n\n**Returns:** `Promise\u003cNotebook\u003e`\n\n**Description:**\nCreates a new notebook. Automatically generates a title if not provided. Validates title length before creation.\n\n**Return Fields:**\n- `projectId: string` - Unique notebook ID (use this for subsequent operations)\n- `title: string` - Notebook title (as provided or auto-generated)\n- `emoji: string` - Default emoji\n\n**Auto-Generated Title Format:**\nIf `title` is empty or not provided, generates: `\"Untitled Notebook {current date}\"`\nExample: `\"Untitled Notebook 12/30/2024\"`\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eValidation\u003c/strong\u003e\u003c/summary\u003e\n\n- Title maximum length: 100 characters\n- Throws `APIError` if title exceeds limit\n- Empty title is allowed (will be auto-generated)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Quota is checked before creation (if quota manager is enabled)\n- Usage is recorded after successful creation\n- Returns immediately with notebook ID - no waiting required\n- Does not include `sourceCount`, `lastAccessed`, or `sharing` (not available for new notebooks)\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\n// With title\nconst notebook = await sdk.notebooks.create({\n  title: 'My Research Project',\n})\n\n// With title and emoji\nconst notebook = await sdk.notebooks.create({\n  title: 'My Research Project',\n  emoji: '📚',\n})\n\n// Auto-generated title\nconst untitled = await sdk.notebooks.create({})\n```\n\n---\n\n### Update Notebook\n\n**Method:** `sdk.notebooks.update(notebookId, options)`\n\n**Example:** [notebook-update.ts](examples/notebook-update.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required, automatically trimmed)\n- `options: UpdateNotebookOptions`\n  - `title?: string` - New title (optional)\n  - `emoji?: string` - New emoji (optional)\n  - `metadata?: Record\u003cstring, any\u003e` - Other metadata updates (optional)\n\n**Returns:** `Promise\u003cNotebook\u003e` (same as `get()` - full notebook details)\n\n**Description:**\nUpdates notebook title or emoji. Returns full notebook details after update (same structure as `get()`). Supports updating emoji only, title only, or both together.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eValidation\u003c/strong\u003e\u003c/summary\u003e\n\n- At least one field (`title` or `emoji`) must be provided\n- Title maximum length: 100 characters\n- Notebook ID is automatically trimmed (removes trailing spaces)\n- Returns error if notebook doesn't exist\n\n\u003c/details\u003e\n\n**Return Fields:**\nSame as `get()` - includes `projectId`, `title`, `emoji`, `sourceCount`, `lastAccessed`, `sharing`\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Notebook ID is trimmed automatically to prevent issues with trailing spaces\n- Only provided fields are updated (partial updates supported)\n- Returns full notebook object after update (not just updated fields)\n- Does not validate notebook existence first (for performance) - returns error if not found\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\n// Update title only\nconst updated = await sdk.notebooks.update('notebook-id', {\n  title: 'Updated Title',\n})\n\n// Update emoji only\nconst updated = await sdk.notebooks.update('notebook-id', {\n  emoji: '🔥',\n})\n\n// Update both title and emoji\nconst updated = await sdk.notebooks.update('notebook-id', {\n  title: 'New Title',\n  emoji: '⭐',\n})\n\n// Update all fields\nconst updated = await sdk.notebooks.update('notebook-id', {\n  title: 'New Title',\n  emoji: '🎯',\n})\n```\n\n---\n\n### Delete Notebook\n\n**Method:** `sdk.notebooks.delete(notebookIds, options?)`\n\n**Example:** [notebook-delete.ts](examples/notebook-delete.ts)\n\n**Parameters:**\n- `notebookIds: string | string[]` - Single notebook ID or array of IDs (required)\n- `options?: DeleteNotebookOptions` - Optional deletion options:\n  - `mode?: 'parallel' | 'sequential'` - Execution mode (default: 'parallel')\n\n**Returns:** `Promise\u003cDeleteNotebookResult\u003e`\n\n**Description:**\nDeletes one or more notebooks. For multiple notebooks, deletions are performed individually (either in parallel or sequentially) since Google's API does not support true batch deletion. Returns confirmation with deleted IDs and count.\n\n**Return Fields:**\n- `deleted: string[]` - Array of successfully deleted notebook IDs\n- `count: number` - Number of notebooks successfully deleted\n- `failed?: string[]` - Array of notebook IDs that failed to delete (only present if some failed)\n- `failedCount?: number` - Number of notebooks that failed to delete\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eValidation\u003c/strong\u003e\u003c/summary\u003e\n\n- All provided IDs are validated before deletion\n- Throws `APIError` if any ID is invalid\n- Supports both single ID and array of IDs\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDeletion Modes\u003c/strong\u003e\u003c/summary\u003e\n\n- **Parallel (default):** All notebooks are deleted simultaneously using `Promise.all()`. Faster but may hit rate limits.\n- **Sequential:** Notebooks are deleted one at a time. Slower but more reliable and avoids rate limit issues.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- No confirmation required - deletion is immediate\n- Google's API does not support batch deletion in a single call\n- Multiple notebooks are deleted individually, one per API call\n- Parallel mode is default but sequential mode is recommended for large batches to avoid rate limits\n- Failed deletions are tracked separately - if some succeed and some fail, you'll get both `deleted` and `failed` arrays\n- Throws error only if ALL deletions fail (partial failures return result with `failed` array)\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\n// Delete single notebook\nconst result = await sdk.notebooks.delete('notebook-id')\nconsole.log(`Deleted ${result.count} notebook: ${result.deleted[0]}`)\n\n// Delete multiple notebooks (parallel - default)\nconst result = await sdk.notebooks.delete(['id-1', 'id-2', 'id-3'])\nconsole.log(`Deleted ${result.count} notebooks: ${result.deleted.join(', ')}`)\n\n// Delete multiple notebooks (sequential - recommended for large batches)\nconst result = await sdk.notebooks.delete(['id-1', 'id-2', 'id-3'], { mode: 'sequential' })\nconsole.log(`Deleted ${result.count} notebooks: ${result.deleted.join(', ')}`)\nif (result.failed \u0026\u0026 result.failed.length \u003e 0) {\n  console.log(`Failed to delete: ${result.failed.join(', ')}`)\n}\n```\n\n---\n\n### Share Notebook\n\n\u003e **⚠️ Experimental:** This feature is experimental and may have limitations or breaking changes in future versions.\n\n**Method:** `sdk.notebooks.share(notebookId, options)`\n\n**Example:** [notebook-share.ts](examples/notebook-share.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required, automatically trimmed)\n- `options: ShareNotebookOptions`\n  - `users?: Array\u003c{email: string, role: 2|3|4}\u003e` - Users to share with (optional)\n  - `notify?: boolean` - Notify users (default: true, only used when users are provided)\n  - `accessType?: 1|2` - Access type: 1=anyone with link, 2=restricted (optional, default: 2)\n\n**Returns:** `Promise\u003cShareNotebookResult\u003e`\n\n**Description:**\nShares notebook with users or enables link sharing. Supports multiple users with different roles. Automatically fetches updated sharing state after operation.\n\n**User Roles:**\n\n| Role | Value | Description |\n|------|-------|-------------|\n| Editor | `2` | Can edit notebook content |\n| Viewer | `3` | Can view notebook only |\n| Remove | `4` | Remove user from shared list |\n\n**Access Types:**\n\n| Access Type | Value | Description |\n|-------------|-------|-------------|\n| Anyone with link | `1` | Public access via share link |\n| Restricted | `2` | Only specified users can access |\n\n**Return Fields:**\n- `shareUrl: string` - Share URL (always present, even if not shared)\n- `success: boolean` - Whether the share operation succeeded\n- `notebookId: string` - The notebook ID that was shared\n- `accessType: 1|2` - Access type: 1=anyone with link, 2=restricted\n- `isShared: boolean` - Whether the notebook is shared (true if shared with users or link enabled)\n- `users?: Array\u003c{email: string, role: 2|3}\u003e` - Users with access (only present if users were shared)\n\n**Notify Behavior:**\n- `notify` is only used when `users` are provided\n- Default: `true` (users are notified when permissions change)\n- Set to `false` to share silently\n- Not used when only changing link access (no user changes)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eValidation\u003c/strong\u003e\u003c/summary\u003e\n\n- Email addresses are validated using regex before sharing\n- Throws `APIError` if any email is invalid\n- Supports multiple users in a single call\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n- Notebook ID is automatically trimmed\n- Makes prerequisite `JFMDGd` call before sharing (to initialize sharing state)\n- After successful share, makes another `JFMDGd` call to fetch updated state\n- `shareUrl` is always returned (constructed from notebook ID if not explicitly shared)\n- Supports sharing with multiple users in a single operation\n- Can combine user sharing with link access in one call\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\n// Share with users (restricted access, notify enabled by default)\nconst result = await sdk.notebooks.share('notebook-id', {\n  users: [\n    { email: 'user1@example.com', role: 2 }, // editor\n    { email: 'user2@example.com', role: 3 }, // viewer\n  ],\n  notify: true,\n  accessType: 2, // restricted\n})\n\n// Share with users (silent, no notification)\nconst result = await sdk.notebooks.share('notebook-id', {\n  users: [\n    { email: 'user@example.com', role: 2 },\n  ],\n  notify: false,\n  accessType: 2,\n})\n\n// Enable link sharing (anyone with link)\nconst result = await sdk.notebooks.share('notebook-id', {\n  accessType: 1, // 1=anyone with link, 2=restricted\n})\n\n// Remove user (role: 4)\nconst result = await sdk.notebooks.share('notebook-id', {\n  users: [\n    { email: 'user@example.com', role: 4 }, // remove\n  ],\n  accessType: 2,\n})\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eSources\u003c/b\u003e - Add \u0026 manage sources\u003c/summary\u003e\n\n### Methods\n\n#### `addFromURL(notebookId: string, options: AddURLSourceOptions)` → `Promise\u003cstring\u003e`\nAdd a source from a URL (web page, YouTube, etc.).\n\n**Parameters:**\n- `notebookId: string` - The notebook ID\n- `options.url: string` - URL to add\n\n**Returns:**\n- `string` - Source ID\n\n**Example:**\n```typescript\nconst sourceId = await sdk.sources.addFromURL('notebook-id', {\n  url: 'https://example.com/article',\n})\n```\n\n---\n\n#### `addFromText(notebookId: string, options: AddTextSourceOptions)` → `Promise\u003cstring\u003e`\nAdd a source from text content.\n\n**Parameters:**\n- `notebookId: string` - The notebook ID\n- `options.title: string` - Source title\n- `options.content: string` - Text content\n\n**Returns:**\n- `string` - Source ID\n\n**Example:**\n```typescript\nconst sourceId = await sdk.sources.addFromText('notebook-id', {\n  title: 'Research Notes',\n  content: 'Your text content here...',\n})\n```\n\n---\n\n#### `addFromFile(notebookId: string, options: AddFileSourceOptions)` → `Promise\u003cstring\u003e`\nAdd a source from a file (PDF, image, etc.).\n\n**Parameters:**\n- `notebookId: string` - The notebook ID\n- `options.content: Buffer` - File content as Buffer\n- `options.fileName: string` - File name\n- `options.mimeType: string` - MIME type (e.g., 'application/pdf')\n\n**Returns:**\n- `string` - Source ID\n\n**Example:**\n```typescript\nimport { readFile } from 'fs/promises'\n\nconst buffer = await readFile('./document.pdf')\nconst sourceId = await sdk.sources.addFromFile('notebook-id', {\n  content: buffer,\n  fileName: 'document.pdf',\n  mimeType: 'application/pdf',\n})\n```\n\n---\n\n#### `addYouTube(notebookId: string, options: AddYouTubeSourceOptions)` → `Promise\u003cstring\u003e`\nAdd a YouTube video as a source.\n\n**Parameters:**\n- `notebookId: string` - The notebook ID\n- `options.urlOrId: string` - YouTube URL or video ID\n\n**Returns:**\n- `string` - Source ID\n\n**Example:**\n```typescript\nconst sourceId = await sdk.sources.addYouTube('notebook-id', {\n  urlOrId: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',\n})\n```\n\n---\n\n#### `searchWebAndWait(notebookId: string, options: SearchWebOptions)` → `Promise\u003cSearchWebResult\u003e`\nSearch the web or Google Drive and wait for results.\n\n**Parameters:**\n- `notebookId: string` - The notebook ID\n- `options.query: string` - Search query\n- `options.sourceType: SearchSourceType` - WEB or GOOGLE_DRIVE\n- `options.mode: ResearchMode` - STANDARD or DEEP\n\n**Returns:**\n- `SearchWebResult` - Object with:\n  - `sessionId: string` - Session ID for adding sources\n  - `sources: Array\u003c{sourceId: string, title: string, ...}\u003e` - Found sources\n\n**Example:**\n```typescript\nimport { SearchSourceType, ResearchMode } from 'notebooklm-kit'\n\nconst result = await sdk.sources.searchWebAndWait('notebook-id', {\n  query: 'machine learning trends 2024',\n  sourceType: SearchSourceType.WEB,\n  mode: ResearchMode.STANDARD,\n})\n\n// Add selected sources\nconst sourceIds = await sdk.sources.addDiscovered('notebook-id', {\n  sessionId: result.sessionId,\n  sourceIds: result.sources.slice(0, 5).map(s =\u003e s.sourceId),\n})\n```\n\n---\n\n#### `pollProcessing(notebookId: string)` → `Promise\u003cSourceProcessingStatus\u003e`\nCheck source processing status.\n\n**Parameters:**\n- `notebookId: string` - The notebook ID\n\n**Returns:**\n- `SourceProcessingStatus` - Object with:\n  - `readyCount: number` - Number of ready sources\n  - `totalCount: number` - Total sources\n  - `processingCount: number` - Sources being processed\n  - `failedCount: number` - Failed sources\n  - `allReady: boolean` - Whether all sources are ready\n\n**Example:**\n```typescript\nconst status = await sdk.sources.pollProcessing('notebook-id')\nconsole.log(`Ready: ${status.readyCount}/${status.totalCount}`)\n```\n\n\u003c/details\u003e\n\n## Sources\n\nExamples: [source-list.ts](examples/source-list.ts) | [source-get.ts](examples/source-get.ts) | [source-add-url.ts](examples/source-add-url.ts) | [source-add-text.ts](examples/source-add-text.ts) | [source-add-file.ts](examples/source-add-file.ts) | [source-add-youtube.ts](examples/source-add-youtube.ts) | [source-add-drive.ts](examples/source-add-drive.ts) | [source-add-batch.ts](examples/source-add-batch.ts) | [source-web-search.ts](examples/source-web-search.ts) | [source-web-search-advanced.ts](examples/source-web-search-advanced.ts) | [source-update.ts](examples/source-update.ts) | [source-delete.ts](examples/source-delete.ts) | [source-status.ts](examples/source-status.ts)\n\n### List Sources\n\n**Method:** `sdk.sources.list(notebookId)`\n\n**Example:** [source-list.ts](examples/source-list.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n\n**Returns:** `Promise\u003cSource[]\u003e`\n\n**Description:**\nRetrieves a list of all sources (URLs, text, files, YouTube videos, Google Drive files, etc.) associated with a notebook. Sources are extracted from the notebook response efficiently without requiring a separate RPC call.\n\n**Return Fields:**\n- `sourceId: string` - Unique identifier for the source\n- `title?: string` - Source title/name\n- `type?: SourceType` - Source type (URL, TEXT, PDF, YOUTUBE_VIDEO, GOOGLE_DRIVE, IMAGE, etc.)\n- `url?: string` - Source URL (for URL/YouTube sources)\n- `createdAt?: string` - Creation timestamp (ISO format)\n- `updatedAt?: string` - Last modified timestamp (ISO format)\n- `status?: SourceStatus` - Processing status (`PROCESSING`, `READY`, `FAILED`)\n- `metadata?: Record\u003cstring, any\u003e` - Additional metadata (file size, MIME type, etc.)\n\n**Source Types:**\n- `URL` - Web page URL\n- `TEXT` - Text content\n- `PDF` - PDF file\n- `YOUTUBE_VIDEO` - YouTube video\n- `GOOGLE_DRIVE` - Google Drive file\n- `IMAGE` - Image file\n- `VIDEO_FILE` - Video file upload\n- `PDF_FROM_DRIVE` - PDF from Google Drive\n- `TEXT_NOTE` - Text note\n- `MIND_MAP_NOTE` - Mind map note\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Sources are extracted from the notebook response (same RPC as `notebooks.get()`)\n- Processing status is inferred from source metadata\n- Returns empty array if notebook has no sources\n- File size and MIME type are included in metadata when available\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\n// List all sources\nconst sources = await sdk.sources.list('notebook-id')\nconsole.log(`Found ${sources.length} sources`)\n\n// Filter by type\nconst pdfs = sources.filter(s =\u003e s.type === SourceType.PDF)\nconst urls = sources.filter(s =\u003e s.type === SourceType.URL)\n\n// Check processing status\nconst ready = sources.filter(s =\u003e s.status === SourceStatus.READY)\nconst processing = sources.filter(s =\u003e s.status === SourceStatus.PROCESSING)\n```\n\n---\n\n### Get Source\n\n**Method:** `sdk.sources.get(notebookId, sourceId?)`\n\n**Example:** [source-get.ts](examples/source-get.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `sourceId?: string` - Optional source ID to get a single source\n\n**Returns:** `Promise\u003cSource | Source[]\u003e` - Single source if `sourceId` provided, array of all sources if omitted\n\n**Description:**\nGet one or all sources from a notebook. If `sourceId` is provided, returns a single source. If omitted, returns all sources (same as `list()`).\n\n**Return Fields:**\nSame as `list()` - see [List Sources](#list-sources) for field descriptions.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Returns array if `sourceId` is omitted (same as `list()`)\n- Returns single source object if `sourceId` is provided\n- Throws error if source not found when `sourceId` is provided\n- Efficiently reuses notebook data (no separate RPC call)\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\n// Get all sources\nconst allSources = await sdk.sources.get('notebook-id')\n\n// Get specific source\nconst source = await sdk.sources.get('notebook-id', 'source-id')\nconsole.log(source.title)\n```\n\n---\n\n### Add URL Source\n\n**Method:** `sdk.sources.add.url(notebookId, options)`\n\n**Example:** [source-add-url.ts](examples/source-add-url.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: AddSourceFromURLOptions`\n  - `url: string` - URL to add (required)\n  - `title?: string` - Optional custom title\n\n**Returns:** `Promise\u003cstring\u003e` - Source ID\n\n**Description:**\nAdds a web page URL as a source. Returns immediately after source is queued. Use `status()` to check if source is ready.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Returns immediately after source is queued (does not wait for processing)\n- Quota is checked before adding\n- Use `status()` to check if source is ready\n- URL must be a valid HTTP/HTTPS URL\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\nconst sourceId = await sdk.sources.add.url('notebook-id', {\n  url: 'https://ai.google.dev/',\n  title: 'Google AI Developer',\n})\n\n// Check if ready\nconst status = await sdk.sources.status('notebook-id')\nif (!status.processing.includes(sourceId)) {\n  console.log('Source is ready!')\n}\n```\n\n---\n\n### Add Text Source\n\n**Method:** `sdk.sources.add.text(notebookId, options)`\n\n**Example:** [source-add-text.ts](examples/source-add-text.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: AddSourceFromTextOptions`\n  - `content: string` - Text content (required)\n  - `title: string` - Source title (required)\n\n**Returns:** `Promise\u003cstring\u003e` - Source ID\n\n**Description:**\nAdds text content as a source. Useful for adding notes, research summaries, or any text-based content.\n\n**Usage:**\n```typescript\nconst sourceId = await sdk.sources.add.text('notebook-id', {\n  title: 'Research Notes',\n  content: 'Key findings from research...',\n})\n```\n\n---\n\n### Add File Source\n\n**Method:** `sdk.sources.add.file(notebookId, options)`\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: AddSourceFromFileOptions`\n  - `content: Buffer | string` - File content as Buffer or base64 string (required)\n  - `fileName: string` - File name (required)\n  - `mimeType?: string` - MIME type (optional, auto-detected if not provided)\n\n**Returns:** `Promise\u003cstring\u003e` - Source ID\n\n**Description:**\nAdds a file (PDF, image, video, etc.) as a source. Supports files as Buffer or base64 string.\n\n**Supported File Types:**\n- PDF files\n- Image files (PNG, JPG, etc.)\n- Video files\n- Other document types\n\n**Usage:**\n```typescript\nimport fs from 'fs'\n\n// From file buffer\nconst fileBuffer = fs.readFileSync('document.pdf')\nconst sourceId = await sdk.sources.add.file('notebook-id', {\n  content: fileBuffer,\n  fileName: 'document.pdf',\n  mimeType: 'application/pdf',\n})\n\n// From base64 string\nconst base64Content = fileBuffer.toString('base64')\nconst sourceId = await sdk.sources.add.file('notebook-id', {\n  content: base64Content,\n  fileName: 'document.pdf',\n})\n```\n\n---\n\n### Add YouTube Source\n\n**Method:** `sdk.sources.add.youtube(notebookId, options)`\n\n**Example:** [source-add-youtube.ts](examples/source-add-youtube.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: AddYouTubeSourceOptions`\n  - `urlOrId: string` - YouTube URL or video ID (required)\n  - `title?: string` - Optional custom title\n\n**Returns:** `Promise\u003cstring\u003e` - Source ID\n\n**Description:**\nAdds a YouTube video as a source. Accepts either full YouTube URL or just the video ID.\n\n**Usage:**\n```typescript\n// From YouTube URL\nconst sourceId = await sdk.sources.add.youtube('notebook-id', {\n  urlOrId: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',\n})\n\n// From video ID\nconst sourceId = await sdk.sources.add.youtube('notebook-id', {\n  urlOrId: 'dQw4w9WgXcQ',\n})\n```\n\n---\n\n### Add Google Drive Source\n\n\u003e **⚠️ Experimental:** This feature is experimental and may have limitations or breaking changes in future versions.\n\n**Method:** `sdk.sources.add.drive(notebookId, options)`\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: AddGoogleDriveSourceOptions`\n  - `fileId: string` - Google Drive file ID (required)\n  - `title?: string` - Optional custom title\n  - `mimeType?: string` - MIME type (optional, inferred if not provided)\n\n**Returns:** `Promise\u003cstring\u003e` - Source ID\n\n**Description:**\nAdds a Google Drive file as a source. Requires the file ID from Google Drive.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDeprecated\u003c/strong\u003e\u003c/summary\u003e\n\nThis method is deprecated. Use `add.batch()` with `type: 'gdrive'` instead.\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\nconst sourceId = await sdk.sources.add.drive('notebook-id', {\n  fileId: '1a2b3c4d5e6f7g8h9i0j',\n  mimeType: 'application/vnd.google-apps.document',\n  title: 'My Document',\n})\n```\n\n---\n\n### Batch Add Sources\n\n**Method:** `sdk.sources.add.batch(notebookId, options)`\n\n**Example:** [source-add-batch.ts](examples/source-add-batch.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: BatchAddSourcesOptions`\n  - `sources: Array\u003c...\u003e` - Array of source inputs (required)\n  - `waitForProcessing?: boolean` - Whether to wait for all sources to be processed (default: false)\n  - `timeout?: number` - Timeout in ms if `waitForProcessing` is true (default: 300000 = 5 minutes)\n  - `pollInterval?: number` - Poll interval in ms (default: 2000 = 2 seconds)\n  - `onProgress?: (ready: number, total: number) =\u003e void` - Progress callback\n\n**Returns:** `Promise\u003cstring[]\u003e` - Array of source IDs\n\n**Description:**\nAdds multiple sources at once. Supports mixed source types (URLs, text, files, YouTube, Google Drive) in a single call.\n\n**Source Types:**\n- `{ type: 'url', url: string, title?: string }` - URL source\n- `{ type: 'text', title: string, content: string }` - Text source\n- `{ type: 'file', content: Buffer | string, fileName: string, mimeType?: string }` - File source\n- `{ type: 'youtube', urlOrId: string, title?: string }` - YouTube source\n- `{ type: 'gdrive', fileId: string, title?: string, mimeType?: string }` - Google Drive source \u003csmall\u003e⚠️ Experimental\u003c/small\u003e\n\n**Usage:**\n```typescript\nconst sourceIds = await sdk.sources.add.batch('notebook-id', {\n  sources: [\n    { type: 'url', url: 'https://example.com', title: 'Example' },\n    { type: 'text', title: 'Notes', content: 'Content here...' },\n    { type: 'youtube', urlOrId: 'dQw4w9WgXcQ' },\n  ],\n  waitForProcessing: true, // Optional: wait for all to be ready\n  timeout: 300000, // 5 minutes\n  onProgress: (ready, total) =\u003e {\n    console.log(`Progress: ${ready}/${total}`)\n  },\n})\n```\n\n---\n\n### Web Search (Simple)\n\n**Method:** `sdk.sources.add.web.searchAndWait(notebookId, options)`\n\n**Example:** [source-web-search.ts](examples/source-web-search.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: SearchWebAndWaitOptions`\n  - `query: string` - Search query (required)\n  - `sourceType?: SearchSourceType` - Source type: `WEB` (default) or `GOOGLE_DRIVE`\n  - `mode?: ResearchMode` - Research mode: `FAST` (default) or `DEEP` (web only)\n  - `timeout?: number` - Max wait time in ms (default: 60000 = 60 seconds)\n  - `pollInterval?: number` - Poll interval in ms (default: 2000 = 2 seconds)\n  - `onProgress?: (status) =\u003e void` - Progress callback\n\n**Returns:** `Promise\u003cWebSearchResult\u003e` - Results with `sessionId`, `web` sources, and `drive` sources\n\n**Description:**\n**RECOMMENDED FOR SIMPLE WORKFLOWS** - One call that searches and waits for results automatically. Returns all discovered sources once available (or timeout). Perfect for automated workflows where you don't need to see intermediate steps.\n\n**Research Modes:**\n- `ResearchMode.FAST` - Quick search (~10-30 seconds, default)\n- `ResearchMode.DEEP` - Comprehensive research (~60-120 seconds, web only)\n\n**Source Types:**\n- `SearchSourceType.WEB` - Search web (default)\n- `SearchSourceType.GOOGLE_DRIVE` - Search Google Drive (FAST mode only) \u003csmall\u003e⚠️ Experimental\u003c/small\u003e\n\n**Return Fields:**\n- `sessionId: string` - Required for adding sources (use with `addDiscovered()`)\n- `web: DiscoveredWebSource[]` - Discovered web sources\n- `drive: DiscoveredDriveSource[]` - Discovered Google Drive sources \u003csmall\u003e⚠️ Experimental\u003c/small\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Automatically polls for results until available or timeout\n- Returns results once count stabilizes (assumes search complete)\n- Progress callback shows result count as search progresses\n- Use returned `sessionId` with `addDiscovered()` to add selected sources\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\nimport { ResearchMode, SearchSourceType } from 'notebooklm-kit'\n\n// Simple search and wait\nconst result = await sdk.sources.add.web.searchAndWait('notebook-id', {\n  query: 'machine learning research papers 2024',\n  mode: ResearchMode.DEEP, // Comprehensive search\n  sourceType: SearchSourceType.WEB,\n  timeout: 120000, // Wait up to 2 minutes\n  onProgress: (status) =\u003e {\n    console.log(`Found ${status.resultCount} results so far...`)\n  },\n})\n\nconsole.log(`Found ${result.web.length} web sources`)\nconsole.log(`Session ID: ${result.sessionId}`)\n\n// Add selected sources\nconst addedIds = await sdk.sources.add.web.addDiscovered('notebook-id', {\n  sessionId: result.sessionId,\n  webSources: result.web.slice(0, 5), // Top 5\n})\n```\n\n---\n\n### Web Search (Advanced)\n\n**Method:** `sdk.sources.add.web.search(notebookId, options)` → `sdk.sources.add.web.getResults(notebookId, sessionId)` → `sdk.sources.add.web.addDiscovered(notebookId, options)`\n\n**Example:** [source-web-search-advanced.ts](examples/source-web-search-advanced.ts)\n\n**Description:**\n**MULTI-STEP WORKFLOW** - For cases where you want to see results and make decisions at each step. Returns intermediate results so you can validate, filter, or select before adding sources.\n\n**Workflow Steps:**\n1. **`search()`** - Start search, returns `sessionId` immediately\n2. **`getResults(sessionId)`** - Get discovered sources (can call multiple times to poll)\n3. **`addDiscovered(sessionId, selectedSources)`** - Add your selected sources\n\n**Step 1: Start Search**\n\n**Method:** `sdk.sources.add.web.search(notebookId, options)`\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: SearchWebSourcesOptions`\n  - `query: string` - Search query (required)\n  - `sourceType?: SearchSourceType` - `WEB` (default) or `GOOGLE_DRIVE`\n  - `mode?: ResearchMode` - `FAST` (default) or `DEEP` (web only)\n\n**Returns:** `Promise\u003cstring\u003e` - Session ID (required for steps 2 and 3)\n\n**Step 2: Get Results**\n\n**Method:** `sdk.sources.add.web.getResults(notebookId, sessionId?)`\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `sessionId?: string` - Session ID from step 1 (optional - if omitted, returns all results)\n\n**Returns:** `Promise\u003c{ web: DiscoveredWebSource[], drive: DiscoveredDriveSource[] }\u003e`\n\n**Step 3: Add Discovered Sources**\n\n**Method:** `sdk.sources.add.web.addDiscovered(notebookId, options)`\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: AddDiscoveredSourcesOptions`\n  - `sessionId: string` - Session ID from step 1 (required)\n  - `webSources?: DiscoveredWebSource[]` - Web sources to add\n  - `driveSources?: DiscoveredDriveSource[]` - Drive sources to add\n\n**Returns:** `Promise\u003cstring[]\u003e` - Array of added source IDs\n\n**Usage:**\n```typescript\n// Step 1: Start search\nconst sessionId = await sdk.sources.add.web.search('notebook-id', {\n  query: 'quantum computing',\n  mode: ResearchMode.FAST,\n})\n\n// Step 2: Poll for results (you control when/how often)\nlet results\ndo {\n  await new Promise(r =\u003e setTimeout(r, 2000)) // Wait 2 seconds\n  results = await sdk.sources.add.web.getResults('notebook-id', sessionId)\n  console.log(`Found ${results.web.length} sources...`)\n} while (results.web.length === 0)\n\n// Step 3: Filter and add selected sources\nconst relevant = results.web.filter(s =\u003e s.url.includes('arxiv.org'))\nconst addedIds = await sdk.sources.add.web.addDiscovered('notebook-id', {\n  sessionId,\n  webSources: relevant,\n})\n```\n\n---\n\n### Get Search Results\n\n**Method:** `sdk.sources.add.web.getResults(notebookId, sessionId?)`\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `sessionId?: string` - Optional session ID to filter results\n\n**Returns:** `Promise\u003c{ web: DiscoveredWebSource[], drive: DiscoveredDriveSource[] }\u003e`\n\n**Description:**\nReturns discovered sources from search sessions. If `sessionId` is provided, filters results to that specific session. If omitted, returns all results (may include results from other searches).\n\n**Usage:**\n```typescript\n// Get results for specific session\nconst results = await sdk.sources.add.web.getResults('notebook-id', sessionId)\n\n// Get all results (no filtering)\nconst allResults = await sdk.sources.add.web.getResults('notebook-id')\n```\n\n---\n\n### Add Discovered Sources\n\n**Method:** `sdk.sources.add.web.addDiscovered(notebookId, options)`\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options: AddDiscoveredSourcesOptions`\n  - `sessionId: string` - Session ID from search (required)\n  - `webSources?: DiscoveredWebSource[]` - Web sources to add\n  - `driveSources?: DiscoveredDriveSource[]` - Drive sources to add\n\n**Returns:** `Promise\u003cstring[]\u003e` - Array of added source IDs\n\n**Description:**\nAdds selected discovered sources from search results. You decide which sources to add (from `getResults()` or `searchAndWait()`).\n\n**Usage:**\n```typescript\n// After searchAndWait()\nconst result = await sdk.sources.add.web.searchAndWait(...)\nconst addedIds = await sdk.sources.add.web.addDiscovered('notebook-id', {\n  sessionId: result.sessionId,\n  webSources: result.web.slice(0, 5), // Top 5\n})\n\n// After manual search workflow\nconst addedIds = await sdk.sources.add.web.addDiscovered('notebook-id', {\n  sessionId: sessionId,\n  webSources: filteredSources,\n  driveSources: selectedDriveSources,\n})\n```\n\n---\n\n### Update Source\n\n**Method:** `sdk.sources.update(notebookId, sourceId, updates)`\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `sourceId: string` - The source ID (required)\n- `updates: Partial\u003cSource\u003e` - Fields to update\n  - `title?: string` - New title\n\n**Returns:** `Promise\u003cvoid\u003e`\n\n**Description:**\nUpdates source metadata. Currently supports updating the title.\n\n**Usage:**\n```typescript\nawait sdk.sources.update('notebook-id', 'source-id', {\n  title: 'Updated Source Title',\n})\n```\n\n---\n\n### Delete Source\n\n**Method:** `sdk.sources.delete(notebookId, sourceId)`\n\n**Example:** [source-delete.ts](examples/source-delete.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `sourceId: string` - The source ID (required)\n\n**Returns:** `Promise\u003cvoid\u003e`\n\n**Description:**\nDeletes a source from a notebook.\n\n**Usage:**\n```typescript\nawait sdk.sources.delete('notebook-id', 'source-id')\n```\n\n---\n\n### Check Processing Status\n\n**Method:** `sdk.sources.status(notebookId)`\n\n**Example:** [source-status.ts](examples/source-status.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n\n**Returns:** `Promise\u003cSourceProcessingStatus\u003e`\n\n**Description:**\nChecks the processing status of all sources in a notebook. Returns information about which sources are still processing and whether all sources are ready.\n\n**Return Fields:**\n- `allReady: boolean` - Whether all sources are ready\n- `processing: string[]` - Array of source IDs still processing\n\n**Usage:**\n```typescript\nconst status = await sdk.sources.status('notebook-id')\n\nif (status.allReady) {\n  console.log('All sources are ready!')\n} else {\n  console.log(`Still processing: ${status.processing.length} sources`)\n  console.log('Processing IDs:', status.processing)\n}\n```\n\n---\n\n## Artifacts\n\nExamples: [artifact-create.ts](examples/artifact-create.ts) | [artifact-create-subservices.ts](examples/artifact-create-subservices.ts) | [artifact-list.ts](examples/artifact-list.ts) | [artifact-get.ts](examples/artifact-get.ts) | [artifact-download.ts](examples/artifact-download.ts) | [artifact-video.ts](examples/artifact-video.ts) | [slide-download-test.ts](examples/slide-download-test.ts) | [artifact-rename.ts](examples/artifact-rename.ts) | [artifact-delete.ts](examples/artifact-delete.ts) | [artifact-share.ts](examples/artifact-share.ts)\n\n### Create Artifact\n\n**Method:** `sdk.artifacts.create(notebookId, type, options)` or `sdk.artifacts.{type}.create(notebookId, options)`\n\n**Examples:** \n- [artifact-create.ts](examples/artifact-create.ts) - Using main `create()` method\n- [artifact-create-subservices.ts](examples/artifact-create-subservices.ts) - Using type-safe sub-service methods\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `type: ArtifactType` - Artifact type (required for main method)\n- `options: CreateArtifactOptions`\n  - `title?: string` - Artifact title (optional)\n  - `instructions?: string` - Instructions for generation (optional)\n  - `sourceIds?: string[]` - Source IDs to use (optional - automatically uses all sources if omitted)\n  - `customization?: object` - Type-specific customization options (optional)\n\n**Returns:** `Promise\u003cArtifact\u003e` (or `Promise\u003cVideoOverview\u003e` / `Promise\u003cAudioOverview\u003e` for video/audio)\n\n**Description:**\nCreates a study material artifact (quiz, flashcards, report, mind map, infographic, slide deck, audio, video). Supports customization options for 6 out of 8 artifact types. Returns immediately with artifact metadata - check `state` field to see if artifact is ready.\n\n**Artifact Types:**\n\n| Type | Value | Customization | Sub-Service |\n|------|-------|---------------|-------------|\n| Quiz | `ArtifactType.QUIZ` | ✅ Yes | `sdk.artifacts.quiz.create()` |\n| Flashcards | `ArtifactType.FLASHCARDS` | ✅ Yes | `sdk.artifacts.flashcard.create()` |\n| Report | `ArtifactType.REPORT` | ❌ No | `sdk.artifacts.report.create()` |\n| Mind Map | `ArtifactType.MIND_MAP` | ❌ No | `sdk.artifacts.mindmap.create()` |\n| Infographic | `ArtifactType.INFOGRAPHIC` | ✅ Yes | `sdk.artifacts.infographic.create()` |\n| Slide Deck | `ArtifactType.SLIDE_DECK` | ✅ Yes | `sdk.artifacts.slide.create()` |\n| Audio | `ArtifactType.AUDIO` | ✅ Yes | `sdk.artifacts.audio.create()` |\n| Video | `ArtifactType.VIDEO` | ✅ Yes | `sdk.artifacts.video.create()` |\n\n**Customization Options:**\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eQuiz Customization\u003c/strong\u003e\u003c/summary\u003e\n\n| Option | Values | Description | Default |\n|-------|--------|-------------|---------|\n| `numberOfQuestions` | `1`, `2`, `3` | **1** = Fewer (5-10 questions), **2** = Standard (10-15 questions), **3** = More (15-20+ questions) | `2` |\n| `difficulty` | `1`, `2`, `3` | **1** = Easy (basic recall), **2** = Medium (application), **3** = Hard (analysis/synthesis) | `2` |\n| `language` | `string` | Language code (e.g., `'en'`, `'hi'`, `'es'`). Use `NotebookLMLanguage` enum for type safety. Supports 80+ languages. | `'en'` |\n\n**Example:**\n```typescript\ncustomization: {\n  numberOfQuestions: 2, // Standard (10-15 questions)\n  difficulty: 2, // Medium difficulty\n  language: NotebookLMLanguage.ENGLISH,\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eFlashcard Customization\u003c/strong\u003e\u003c/summary\u003e\n\n| Option | Values | Description | Default |\n|-------|--------|-------------|---------|\n| `numberOfCards` | `1`, `2`, `3` | **1** = Fewer (10-15 cards), **2** = Standard (15-25 cards), **3** = More (25-40+ cards) | `2` |\n| `difficulty` | `1`, `2`, `3` | **1** = Easy (basic terms), **2** = Medium (concepts), **3** = Hard (complex relationships) | `2` |\n| `language` | `string` | Language code (e.g., `'en'`, `'hi'`, `'es'`). Use `NotebookLMLanguage` enum for type safety. Supports 80+ languages. | `'en'` |\n\n**Example:**\n```typescript\ncustomization: {\n  numberOfCards: 3, // More cards (25-40+)\n  difficulty: 1, // Easy (basic terms)\n  language: NotebookLMLanguage.ENGLISH,\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eSlide Deck Customization\u003c/strong\u003e\u003c/summary\u003e\n\n| Option | Values | Description | Default |\n|-------|--------|-------------|---------|\n| `format` | `2`, `3` | **2** = Presenter slides (concise, bullet points), **3** = Detailed deck (comprehensive, full content) | `2` |\n| `length` | `1`, `2` | **1** = Short (5-10 slides), **2** = Default (10-15 slides) | `2` |\n| `language` | `string` | Language code (e.g., `'en'`, `'hi'`, `'es'`). Use `NotebookLMLanguage` enum for type safety. Supports 80+ languages. | `'en'` |\n\n**Example:**\n```typescript\ncustomization: {\n  format: 2, // Presenter slides (concise)\n  length: 2, // Default (10-15 slides)\n  language: NotebookLMLanguage.ENGLISH,\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eInfographic Customization\u003c/strong\u003e\u003c/summary\u003e\n\n| Option | Values | Description | Default |\n|-------|--------|-------------|---------|\n| `orientation` | `1`, `2`, `3` | **1** = Landscape (wide format), **2** = Portrait (tall format), **3** = Square (1:1 aspect ratio) | `1` |\n| `levelOfDetail` | `1`, `2`, `3` | **1** = Concise (key points only), **2** = Standard (balanced detail), **3** = Detailed (comprehensive information) | `2` |\n| `language` | `string` | Language code (e.g., `'en'`, `'hi'`, `'es'`). Use `NotebookLMLanguage` enum for type safety. Supports 80+ languages. | `'en'` |\n\n**Example:**\n```typescript\ncustomization: {\n  orientation: 1, // Landscape (wide format)\n  levelOfDetail: 2, // Standard detail\n  language: NotebookLMLanguage.ENGLISH,\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eAudio Customization\u003c/strong\u003e\u003c/summary\u003e\n\n| Option | Values | Description | Default |\n|-------|--------|-------------|---------|\n| `format` | `0`, `1`, `2`, `3` | **0** = Deep dive (comprehensive analysis), **1** = Brief (quick summary), **2** = Critique (critical analysis), **3** = Debate (multiple perspectives) | `0` |\n| `length` | `1`, `2`, `3` | **1** = Short (2-5 minutes), **2** = Default (5-10 minutes), **3** = Long (10-15+ minutes) | `2` |\n| `language` | `string` | Language code (e.g., `'en'`, `'hi'`, `'es'`). Use `NotebookLMLanguage` enum for type safety. Supports 80+ languages. | `'en'` |\n\n**Note:** If `sourceIds` is omitted, all sources in the notebook are automatically used.\n\n**Example:**\n```typescript\ncustomization: {\n  format: 0, // Deep dive (comprehensive analysis)\n  length: 2, // Default (5-10 minutes)\n  language: NotebookLMLanguage.ENGLISH,\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eVideo Customization\u003c/strong\u003e\u003c/summary\u003e\n\n| Option | Values | Description | Default |\n|-------|--------|-------------|---------|\n| `format` | `1`, `2` | **1** = Explainer (comprehensive explanation), **2** = Brief (quick overview) | `1` |\n| `visualStyle` | `0-10` | Visual style for the video (see table below) | `0` |\n| `focus` | `string` | What should the AI hosts focus on? (optional, e.g., \"Key concepts and main findings\") | - |\n| `customStyleDescription` | `string` | Custom visual style description (required when `visualStyle=1`) | - |\n| `language` | `string` | Language code (e.g., `'en'`, `'hi'`, `'es'`). Use `NotebookLMLanguage` enum for type safety. Supports 80+ languages. | `'en'` |\n\n**Visual Style Options:**\n\n| Value | Style Name | Description |\n|-------|------------|-------------|\n| `0` | Auto-select | AI chooses the best style automatically (default) |\n| `1` | Custom | Requires `customStyleDescription` - describe your desired style |\n| `2` | Classic | Traditional, professional style |\n| `3` | Whiteboard | Hand-drawn whiteboard style |\n| `4` | Kawaii | Cute, colorful style |\n| `5` | Anime | Anime-inspired style |\n| `6` | Watercolour | Watercolor painting style |\n| `7` | Anime (alternative) | Alternative anime style |\n| `8` | Retro print | Vintage print/poster style |\n| `9` | Heritage | Traditional ink-wash/woodcut style |\n| `10` | Paper-craft | Layered paper cutout style |\n\n**Note:** \n- All styles except Custom (`1`) support only the `focus` option\n- Custom (`1`) additionally requires `customStyleDescription`\n- If `sourceIds` is omitted, all sources in the notebook are automatically used\n\n**Example:**\n```typescript\n// Auto-select style\ncustomization: {\n  format: 1, // Explainer\n  visualStyle: 0, // Auto-select (AI chooses)\n  focus: 'Key concepts and main findings',\n  language: NotebookLMLanguage.ENGLISH,\n}\n\n// Custom style\ncustomization: {\n  format: 1, // Explainer\n  visualStyle: 1, // Custom\n  customStyleDescription: 'Modern minimalist design with blue and white colors',\n  focus: 'Key concepts and main findings',\n  language: NotebookLMLanguage.ENGLISH,\n}\n\n// Specific style (e.g., Whiteboard)\ncustomization: {\n  format: 1, // Explainer\n  visualStyle: 3, // Whiteboard style\n  focus: 'Step-by-step explanation of the process',\n  language: NotebookLMLanguage.ENGLISH,\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eReport \u0026 Mind Map (No Customization)\u003c/strong\u003e\u003c/summary\u003e\n\n**Report** and **Mind Map** artifacts do not support customization options. They only support:\n- `title?: string` - Artifact title (optional)\n- `instructions?: string` - Custom instructions for generation (optional)\n- `sourceIds?: string[]` - Source IDs to use (optional - automatically uses all sources if omitted)\n\n**Example:**\n```typescript\n// Create report\nconst report = await sdk.artifacts.report.create('notebook-id', {\n  title: 'Research Report',\n  instructions: 'Create a comprehensive research report',\n  sourceIds: ['source-id-1', 'source-id-2'], // Optional\n})\n\n// Create mind map\nconst mindMap = await sdk.artifacts.mindmap.create('notebook-id', {\n  title: 'Concept Map',\n  instructions: 'Create a visual mind map of key concepts',\n  sourceIds: ['source-id-1'], // Optional\n})\n```\n\n\u003c/details\u003e\n\n**Source Selection:**\n\n- `sourceIds` is **optional** for all artifact types\n- If omitted or empty, **all sources** in the notebook are automatically used\n- If provided, only the specified sources are used\n\n**Return Fields:**\n- `artifactId: string` - Unique artifact ID (required for other operations)\n- `type: ArtifactType` - Artifact type\n- `state: ArtifactState` - Current state: `CREATING`, `READY`, or `FAILED`\n- `title: string` - Artifact title\n- `sourceIds?: string[]` - Source IDs used to create the artifact\n- `createdAt?: string` - Creation timestamp\n- `updatedAt?: string` - Last update timestamp\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Artifacts are created asynchronously - check `state` field to see if ready\n- Use `get(artifactId)` to fetch full artifact data when `state === READY`\n- Quota is checked before creation (if quota manager is enabled)\n- Usage is recorded after successful creation\n- Audio and video artifacts return `AudioOverview` / `VideoOverview` instead of `Artifact`\n- Sub-services provide type-safe convenience methods (e.g., `sdk.artifacts.quiz.create()`)\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\nimport { ArtifactType } from 'notebooklm-kit'\n\n// Generic create method\nconst quiz = await sdk.artifacts.create('notebook-id', ArtifactType.QUIZ, {\n  title: 'Chapter 1 Quiz',\n  instructions: 'Create questions covering key concepts',\n  customization: {\n    numberOfQuestions: 2, // Standard\n    difficulty: 2, // Medium\n    language: 'en',\n  },\n})\n\n// Using sub-services (type-safe)\nconst quiz = await sdk.artifacts.quiz.create('notebook-id', {\n  title: 'Chapter 1 Quiz',\n  instructions: 'Create questions covering key concepts',\n  customization: {\n    numberOfQuestions: 2,\n    difficulty: 2,\n    language: 'en',\n  },\n})\n\nconst flashcards = await sdk.artifacts.flashcard.create('notebook-id', {\n  customization: {\n    numberOfCards: 3, // More cards\n    difficulty: 1, // Easy\n  },\n})\n\nconst video = await sdk.artifacts.video.create('notebook-id', {\n  instructions: 'Create a summary video',\n  customization: {\n    format: 1,\n    visualStyle: 0,\n    language: 'en',\n  },\n})\n\n// Check if ready\nif (quiz.state === ArtifactState.READY) {\n  const fullQuiz = await sdk.artifacts.get(quiz.artifactId, 'notebook-id')\n}\n```\n\n---\n\n### List Artifacts\n\n**Method:** `sdk.artifacts.list(notebookId, options?)`\n\n**Example:** [artifact-list.ts](examples/artifact-list.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required)\n- `options?: { type?: ArtifactType; state?: ArtifactState }` - Filtering options (optional)\n\n**Returns:** `Promise\u003cArtifact[]\u003e`\n\n**Description:**\nLists all artifacts in a notebook. Supports filtering by type and/or state. Returns lightweight artifact metadata for display/selection.\n\n**Return Fields:**\n- `artifactId: string` - Unique artifact ID\n- `type: ArtifactType` - Artifact type\n- `state: ArtifactState` - Current state (`CREATING`, `READY`, `FAILED`)\n- `title: string` - Artifact title\n- `sourceIds?: string[]` - Source IDs used\n- `createdAt?: string` - Creation timestamp\n- `updatedAt?: string` - Last update timestamp\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Returns all artifact types (quiz, flashcards, report, mind map, infographic, slide deck, audio, video)\n- Filtering is optional - returns all artifacts if no filters provided\n- Does not include full artifact content (use `get()` for that)\n- Check `state` field to see if artifacts are ready before fetching content\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\nimport { ArtifactType, ArtifactState } from 'notebooklm-kit'\n\n// List all artifacts\nconst artifacts = await sdk.artifacts.list('notebook-id')\nconsole.log(`Found ${artifacts.length} artifacts`)\n\n// Filter by type\nconst quizzes = await sdk.artifacts.list('notebook-id', {\n  type: ArtifactType.QUIZ,\n})\n\n// Filter by state\nconst ready = await sdk.artifacts.list('notebook-id', {\n  state: ArtifactState.READY,\n})\n\n// Filter by both type and state\nconst readyQuizzes = await sdk.artifacts.list('notebook-id', {\n  type: ArtifactType.QUIZ,\n  state: ArtifactState.READY,\n})\n\n// Display artifacts\nartifacts.forEach(artifact =\u003e {\n  console.log(`${artifact.title} (${artifact.type}) - ${artifact.state}`)\n})\n```\n\n---\n\n### Get Artifact\n\n**Method:** `sdk.artifacts.get(artifactId, notebookId?, options?)`\n\n**Examples:** [artifact-get.ts](examples/artifact-get.ts) | [artifact-video.ts](examples/artifact-video.ts) (video-specific) | [slide-download-test.ts](examples/slide-download-test.ts) (slide-specific)\n\n**Parameters:**\n- `artifactId: string` - The artifact ID from `create()` or `list()` (required)\n- `notebookId?: string` - Optional notebook ID (helpful for audio/video if get() needs it)\n- `options?: { exportToDocs?: boolean; exportToSheets?: boolean }` - Export options (for reports only)\n\n**Returns:** `Promise\u003cArtifact | QuizData | FlashcardData | AudioArtifact | VideoArtifact | any\u003e`\n\n**Description:**\nRetrieves detailed artifact information. Automatically fetches full content when artifact is `READY`:\n- **Quiz/Flashcards**: Returns full data (questions, flashcards array, CSV)\n- **Audio**: Returns audio metadata (use `download()` to get audio file)\n- **Video**: Returns video URL in `videoData` field (use `download()` to download video file)\n- **Slides**: Returns slide image URLs (use `download()` to download slides as PDF/PNG)\n- **Reports**: Returns basic metadata (use `download()` to get report content, or `get()` with export options for Google Docs/Sheets)\n- **Infographics**: Returns image data with dimensions\n- **Mind Maps**: Returns with `experimental: true` flag\n\n**Return Types by Artifact Type:**\n\n| Type | Returns | Content |\n|------|---------|---------|\n| Quiz | `QuizData` | Questions, options, correct answers, explanations |\n| Flashcards | `FlashcardData` | Flashcards array, CSV, totalCards |\n| Audio | `AudioArtifact` | Audio metadata (use `download()` for audio file) |\n| Video | `Artifact` | Video URL in `videoData` field (use `download()` to download) |\n| Slides | `Artifact` | Slide image URLs in `slideUrls` array (use `download()` to download) |\n| Report | `Artifact` | Basic metadata (artifactId, notebookId, state, title) - use `download()` for content or export options |\n| Infographic | `InfographicImageData` | Image data, dimensions, URL |\n| Mind Map | `Artifact` | Metadata with `experimental: true` |\n\n**Important Notes:**\n- **Videos \u0026 Slides**: `get()` returns URLs/links only, not downloaded files. Use `download()` method to actually download files.\n- **Reports**: `get()` returns basic metadata only. Use `download()` to get report content, or use export options below.\n- **Audio**: `get()` may not include audio data. Use `download()` to get the audio file.\n\n**Report Export Options:**\n- `exportToDocs?: boolean` - Export to Google Docs and return export URL\n- `exportToSheets?: boolean` - Export to Google Sheets and return export URL\n- If neither provided, returns basic artifact metadata only (use `download()` for content)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eValidation\u003c/strong\u003e\u003c/summary\u003e\n\n- Export options (`exportToDocs`, `exportToSheets`) can only be used with `REPORT` artifacts\n- Throws error if export options are used on non-report artifacts\n- `notebookId` is required for audio artifacts (must match `artifactId`)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Automatically detects artifact type and fetches appropriate content\n- For `READY` artifacts, returns full data instead of just metadata\n- For `CREATING` or `FAILED` artifacts, returns metadata only\n- **Videos \u0026 Slides**: Returns URLs only (use `download()` to download files)\n- **Reports**: Returns basic metadata only (use `download()` for content or export options)\n- Quiz and flashcards return full structured data\n- Audio may not include audio data in `get()` - use `download()` to get audio file\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\nimport { ArtifactType, ArtifactState } from 'notebooklm-kit'\n\n// Get quiz with full data\nconst quiz = await sdk.artifacts.get('quiz-id', 'notebook-id')\nif (quiz.state === ArtifactState.READY) {\n  console.log(`Quiz: ${quiz.title}`)\n  console.log(`Questions: ${quiz.questions?.length || 0}`)\n  quiz.questions?.forEach((q, i) =\u003e {\n    console.log(`Q${i + 1}: ${q.question}`)\n  })\n}\n\n// Get flashcards with full data\nconst flashcards = await sdk.artifacts.get('flashcard-id', 'notebook-id')\nif (flashcards.state === ArtifactState.READY) {\n  console.log(`Total cards: ${flashcards.totalCards}`)\n  flashcards.flashcards?.forEach(card =\u003e {\n    console.log(`Q: ${card.question} | A: ${card.answer}`)\n  })\n}\n\n// Get video URL (use download() to download file)\nconst video = await sdk.artifacts.get('video-id', 'notebook-id')\nconsole.log(`Video URL: ${video.videoData}`)\n// To download: await sdk.artifacts.download('video-id', './downloads', 'notebook-id')\n\n// Get slide URLs (use download() to download files)\nconst slides = await sdk.artifacts.get('slide-id', 'notebook-id')\nconsole.log(`Slide URLs: ${slides.slideUrls?.length || 0} slides`)\nslides.slideUrls?.forEach((url, i) =\u003e {\n  console.log(`Slide ${i + 1}: ${url}`)\n})\n// To download: await sdk.artifacts.download('slide-id', './downloads', 'notebook-id')\n\n// Get report metadata (use download() for content or export options)\nconst report = await sdk.artifacts.get('report-id', 'notebook-id')\nconsole.log(`Report: ${report.title} (${report.state})`)\n// To get content: await sdk.artifacts.download('report-id', './downloads', 'notebook-id')\n\n// Export report to Google Docs\nconst report = await sdk.artifacts.get('report-id', 'notebook-id', {\n  exportToDocs: true,\n})\nconsole.log(`Docs URL: ${report.exportUrl}`)\n\n// Export report to Google Sheets\nconst report = await sdk.artifacts.get('report-id', 'notebook-id', {\n  exportToSheets: true,\n})\nconsole.log(`Sheets URL: ${report.exportUrl}`)\n\n// Get audio metadata (use download() to get audio file)\nconst audioArtifact = await sdk.artifacts.audio.create('notebook-id')\nconst audio = await sdk.artifacts.get(audioArtifact.audioId, 'notebook-id')\nconsole.log(`Audio: ${audio.title} (${audio.state})`)\n// To download: await sdk.artifacts.download(audioArtifact.audioId, './downloads', 'notebook-id')\n```\n\n---\n\n### Download Artifact\n\n**Method:** `sdk.artifacts.download(artifactId, folderPath, notebookId?)`\n\n**Example:** [artifact-download.ts](examples/artifact-download.ts)\n\n**Parameters:**\n- `artifactId: string` - The artifact ID from `create()` or `list()` (required)\n- `folderPath: string` - Output folder path (required)\n- `notebookId?: string` - Optional notebook ID (helpful for audio/video if download needs it)\n\n**Returns:** `Promise\u003c{ filePath: string; data: any }\u003e`\n\n**Description:**\nDownloads artifact content and saves to disk. Automatically determines file format and saves with appropriate filename.\n\n**Supported Artifacts:**\n\n| Type | Format | Filename | Content |\n|------|--------|----------|---------|\n| Quiz | JSON | `quiz_{artifactId}_{timestamp}.json` | Complete quiz data with questions, options, answers, explanations |\n| Flashcards | JSON | `flashcard_{artifactId}_{timestamp}.json` | Complete flashcard data with array, CSV, totalCards |\n| Audio | Audio file | `audio_{artifactId}.mp3` | Audio file (binary) |\n| Video | MP4 file | `\u003cartifact-title\u003e.mp4` | Video downloaded as MP4 using Playwright |\n| Slides | PDF file | `\u003cartifact-title\u003e.pdf` or `\u003cartifact-title\u003e/slide_*.png` | Slides downloaded as PDF (default) or PNG files using Playwright |\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Quiz and flashcards are saved as JSON files with complete data\n- Audio is saved as binary file (format depends on backend)\n- Video and slides are downloaded using Playwright for authentication\n- Videos are downloaded as MP4 files\n- Slides are downloaded as PDF (default) or PNG files\n- For PDF downloads, `pdf-lib` package is recommended (falls back to PNG if not available)\n- PNG files are saved in a subfolder named after the artifact\n- Files are saved with timestamps to avoid overwrites (except for slides which use artifact title)\n- Returns both file path and parsed data (for quiz/flashcards)\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\n// Download quiz\nconst result = await sdk.artifacts.download('quiz-id', './downloads', 'notebook-id')\nconsole.log(`Saved to: ${result.filePath}`)\nconsole.log(`Questions: ${result.data.questions?.length || 0}`)\n\n// Download flashcards\nconst result = await sdk.artifacts.download('flashcard-id', './downloads', 'notebook-id')\nconsole.log(`Saved to: ${result.filePath}`)\nconsole.log(`Total cards: ${result.data.totalCards}`)\n\n// Download audio (use audioId from create() or list())\nconst audio = await sdk.artifacts.audio.create('notebook-id')\nconst result = await sdk.artifacts.download(audio.audioId, './downloads', 'notebook-id')\nconsole.log(`Audio saved to: ${result.filePath}`)\n\n// Download video (use download() method)\nconst result = await sdk.artifacts.download('video-id', './downloads', 'notebook-id')\nconsole.log(`Video saved to: ${result.filePath}`)\n\n// Download slides (use download() method)\nconst slidesResult = await sdk.artifacts.download('slide-id', './downloads', 'notebook-id')\nconsole.log(`Slides saved to: ${slidesResult.filePath}`)\n\n// Download report (use download() method)\nconst reportResult = await sdk.artifacts.download('report-id', './downloads', 'notebook-id')\nconsole.log(`Report saved to: ${reportResult.filePath}`)\n```\n\n---\n\n### Download Video\n\n**Method:** `sdk.artifacts.download(videoId, outputPath, notebookId)`\n\n**Example:** [artifact-video.ts](examples/artifact-video.ts)\n\n**Parameters:**\n- `videoId` (string, required): The video artifact ID\n- `outputPath` (string, required): Directory path to save the downloaded video\n- `notebookId` (string, required): The notebook ID containing the video\n\n**Returns:** `{ filePath: string, data: Artifact }` - File path and artifact data\n\n**Description:**\nDownloads a video artifact as an MP4 file. Uses Playwright for authentication and Node's native http/https for reliable download with real-time progress tracking. The video file is saved with the artifact title as the filename.\n\n**Important Notes:**\n- **Use `get()` to get video URL**: `get()` returns the video URL in `videoData` field, not a downloaded file\n- **Use `download()` to download**: `download()` method downloads the video file to disk\n- Video must be in `READY` state before downloading (check with `get()` first)\n- Requires `GOOGLE_EMAIL` and `GOOGLE_PASSWORD` environment variables for authentication\n- Uses Playwright for authentication and Node's http/https for reliable streaming download\n- Shows real-time download progress (percentage and progress bar)\n- Video is saved as `\u003cartifact-title\u003e.mp4` in the specified output directory\n\n**Usage:**\n```typescript\n// Get video URL (get() returns URL only)\nconst video = await sdk.artifacts.get('video-id', 'notebook-id')\nconsole.log(`Video URL: ${video.videoData}`)\n\n// Download video (download() saves file to disk)\nconst result = await sdk.artifacts.download('video-id', './downloads', 'notebook-id')\nconsole.log(`Video saved to: ${result.filePath}`)\n```\n\n**Example Workflow:**\n```typescript\n// 1. Check video status and get URL\nconst video = await sdk.artifacts.get('video-id', 'notebook-id')\nconsole.log(`Video URL: ${video.videoData}`)\nif (video.state === ArtifactState.READY) {\n  // 2. Download video\n  const downloaded = await sdk.artifacts.download('video-id', './downloads', 'notebook-id')\n  console.log(`Downloaded: ${downloaded.filePath}`)\n}\n```\n\n---\n\n### Download Slides\n\n**Method:** `sdk.artifacts.download(slideId, outputPath, notebookId, { downloadAs })`\n\n**Example:** [slide-download-test.ts](examples/slide-download-test.ts)\n\n**Interactive Example (`slide-download-test.ts`):**\n\nThe `slide-download-test.ts` example provides an interactive script for downloading slide decks:\n\n1. **Lists and selects notebooks** - Shows all available notebooks and prompts for selection\n2. **Lists and selects slide artifacts** - Displays all ready slide deck artifacts for the selected notebook\n3. **Extracts slide image URLs** - Recursively searches artifact data structure to find slide image URLs\n4. **Authenticates with Google** - Uses Playwright to authenticate with Google (handles 2FA)\n5. **Downloads images** - Downloads each slide image using authenticated browser session\n6. **Saves in requested format** - Saves as PNG (individual files) or PDF (single file)\n\n**Environment Variables for `slide-download-test.ts`:**\n- `NOTEBOOK_ID` - Optional: Pre-select a notebook ID (skips notebook selection)\n- `GOOGLE_EMAIL` - Required: Google account email for authentication\n- `GOOGLE_PASSWORD` - Required: Google account password for authentication\n- `DOWNLOAD_AS` - Optional: `'pdf'` or `'png'` (defaults to interactive prompt)\n- `OUTPUT_DIR` - Optional: Output directory path (defaults to `./downloads`)\n\n**Usage:**\n```bash\n# Using tsx (recommended)\nNOTEBOOK_ID=your-notebook-id GOOGLE_EMAIL=your@email.com GOOGLE_PASSWORD=yourpassword DOWNLOAD_AS=pdf npx tsx examples/slide-download-test.ts\n\n# Or set environment variables separately\nexport GOOGLE_EMAIL=your@email.com\nexport GOOGLE_PASSWORD=yourpassword\nexport DOWNLOAD_AS=pdf\nnpx tsx examples/slide-download-test.ts\n```\n\n**SDK Method Parameters:**\n- `slideId` (string, required): The slide artifact ID\n- `outputPath` (string, required): Directory path to save the downloaded slides\n- `notebookId` (string, required): The notebook ID containing the slides\n- `downloadAs` (string, optional): Download format - `'pdf'` (default) or `'png'`\n\n**Returns:** `{ filePath: string, data: Artifact }` - File path and artifact data\n\n**Description:**\nDownloads a slide deck artifact as PDF (default) or PNG files. Uses Playwright for authentication and handles the download automatically. PDF format saves all slides in a single file, while PNG format saves each slide as a separate image file.\n\n**Format Options:**\n\n**PDF (default):**\n- Single PDF file containing all slides\n- Filename: `\u003cartifact-title\u003e.pdf`\n- Saved directly in the output directory\n\n**PNG:**\n- Individual PNG files for each slide\n- Saved in a subfolder named after the artifact: `\u003cartifact-title\u003e/`\n- Filenames: `slide_1.png`, `slide_2.png`, etc.\n\n**Important Notes:**\n- **Use `get()` to get slide URLs**: `get()` returns slide image URLs in `slideUrls` array, not downloaded files\n- **Use `download()` to download**: `download()` method downloads the slides to disk\n- Slides must be in `READY` state before downloading (check with `get()` first)\n- Requires cookies to be configured in the RPC client\n- Uses Playwright headless browser for authenticated download\n- PDF generation uses `pdf-lib` if available, falls back to PNG if not installed\n- PNG files are always saved individually in a subfolder\n\n**Usage:**\n```typescript\n// Get slide URLs (get() returns URLs only)\nconst slides = await sdk.artifacts.get('slide-id', 'notebook-id')\nconsole.log(`Slide URLs: ${slides.slideUrls?.length || 0} slides`)\nslides.slideUrls?.forEach((url, i) =\u003e {\n  console.log(`Slide ${i + 1}: ${url}`)\n})\n\n// Download as PDF (default) - use download() method\nconst result = await sdk.artifacts.download('slide-id', './downloads', 'notebook-id')\nconsole.log(`PDF saved to: ${result.filePath}`)\n\n// Download as PNG files - use download() method\nconst resultPng = await sdk.artifacts.download('slide-id', './downloads', 'notebook-id', { \n  downloadAs: 'png'\n})\nconsole.log(`PNG files saved to: ${resultPng.filePath}`)\n```\n\n**Example Workflow:**\n```typescript\n// 1. Check slide status and get URLs\nconst slides = await sdk.artifacts.get('slide-id', 'notebook-id')\nconsole.log(`Slide URLs: ${slides.slideUrls?.length || 0} slides`)\nif (slides.state === ArtifactState.READY) {\n  // 2. Download as PDF (default)\n  const downloaded = await sdk.artifacts.download('slide-id', './downloads', 'notebook-id')\n  console.log(`Downloaded PDF: ${downloaded.filePath}`)\n  \n  // Or download as PNG files\n  const pngSlides = await sdk.artifacts.download('slide-id', './downloads', 'notebook-id', { \n    downloadAs: 'png'\n  })\n  console.log(`Downloaded PNGs: ${pngSlides.filePath}`)\n}\n```\n\n---\n\n### Rename Artifact\n\n**Method:** `sdk.artifacts.rename(artifactId, newTitle)`\n\n**Example:** [artifact-rename.ts](examples/artifact-rename.ts)\n\n**Parameters:**\n- `artifactId: string` - The artifact ID (required)\n- `newTitle: string` - New title (required)\n\n**Returns:** `Promise\u003cArtifact\u003e`\n\n**Description:**\nRenames an artifact. Updates only the title field. Works for all artifact types.\n\n**Return Fields:**\nSame as `get()` - returns updated artifact with new title\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Only updates the title - other fields remain unchanged\n- Works for all artifact types (quiz, flashcards, report, mind map, infographic, slide deck, audio, video)\n- Returns full artifact object after update\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\n// Rename any artifact\nconst updated = await sdk.artifacts.rename('artifact-id', 'My Updated Quiz')\nconsole.log(`New title: ${updated.title}`)\n\n// Rename audio artifact (use audioId from create() or list())\nconst audio = await sdk.artifacts.audio.create('notebook-id')\nconst renamed = await sdk.artifacts.rename(audio.audioId, 'My Audio Overview')\n```\n\n---\n\n### Delete Artifact\n\n**Method:** `sdk.artifacts.delete(artifactId, notebookId?)`\n\n**Example:** [artifact-delete.ts](examples/artifact-delete.ts)\n\n**Parameters:**\n- `artifactId: string` - The artifact ID from `create()` or `list()` (required)\n- `notebookId?: string` - Optional notebook ID (helpful if `get()` fails for audio/video)\n\n**Returns:** `Promise\u003cvoid\u003e`\n\n**Description:**\nPermanently deletes an artifact. Works for all artifact types. This action cannot be undone. Automatically detects artifact type and uses the correct RPC method.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/summary\u003e\n\n- Deletion is permanent and cannot be undone\n- Works for all artifact types (quiz, flashcards, report, mind map, infographic, slide deck, audio, video)\n- Automatically detects artifact type by calling `get()` first\n- Audio and video artifacts use V5N4be RPC with `[[2], artifactId]` structure\n- Other artifacts use WxBZtb RPC with `[artifactId]` structure\n- If `get()` fails, tries both methods (V5N4be first, then standard delete)\n- Audio and video artifacts have their own artifactId (not the notebook ID)\n\n\u003c/details\u003e\n\n**Usage:**\n```typescript\n// Delete any artifact (recommended - automatically detects type)\nawait sdk.artifacts.delete('artifact-id')\n\n// Delete with notebook ID (helpful if get() fails)\nawait sdk.artifacts.delete('artifact-id', 'notebook-id')\n\n// Note: Audio and video artifacts have their own artifactId from create() or list()\nconst audio = await sdk.artifacts.audio.create('notebook-id')\nawait sdk.artifacts.delete(audio.audioId) // Use audioId, not notebookId\n```\n\n---\n\n### Share Artifact\n\n**Method:** `sdk.artifacts.share(notebookId, options)`\n\n**Example:** [artifact-share.ts](examples/artifact-share.ts)\n\n**Parameters:**\n- `notebookId: string` - The notebook ID (required, artifacts are shared at notebook level)\n- `options: ShareArtifactOptions`\n  - `users?: Array\u003c{email: string, role: 2|3|4}\u003e` - Users to share with (optional)\n  - `notify?: boolean` - Notify users (default: true, only used when users are provided)\n  - `accessType?: 1|2` - Access type: 1=anyone with link, 2=restricted (optional, default: 2)\n\n**Returns:** `Promise\u003cShareArtifactResult\u003e`\n\n**Description:**\nShares an artifact (or the notebook containing the artifact) with specific users or makes it publicly accessible via a shareable link. Artifacts are shared at the notebook level, so sharing an artifact shares the entire notebook.\n\n**User Roles:**\n\n| Role | Value | Description |\n|------|-------|-------------|\n| Editor | `2` | Can edit notebook content |\n| Viewer | `3` | Can view notebook only |\n| Remove | `4` | Remove user from shared list |\n\n**Access Types:**\n\n| Access Type | Value | Description |\n|-------------|-------|-------------|\n| Anyone with link | `1` | Public access via share link |\n| Restricted | `2` | Only specified users can access |\n\n**Return Fields:**\n- `shareUrl: string` - Share URL (always present)\n- `success: boolean` - Whether the share operation succeeded\n- `notebookId: string` - The notebook ID that was shared\n- `accessType: 1|2` - Access type\n- `isShared: boolean` - Whether the notebook is shared\n- `users?: Array\u003c{email: string, role: 2|3}\u003e` - Users with access (if users were shared)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eValidation\u003c/strong\u003e\u003c/summary\u003e\n\n- Email addresses are validated using regex before s","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoton-hq%2Fnotebooklm-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphoton-hq%2Fnotebooklm-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoton-hq%2Fnotebooklm-kit/lists"}