{"_id":"@cassina/langgraphjs-checkpoint-firestore","name":"@cassina/langgraphjs-checkpoint-firestore","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@cassina/langgraphjs-checkpoint-firestore","version":"1.0.0","description":"LangGraph.js Checkpoint implementation for Firestore","type":"module","engines":{"node":">=18"},"main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git+ssh://git@github.com/cassina/langgraphjs-checkpoint-firestore.git"},"scripts":{"build":"tsup","check-types":"tsc --noEmit","emulator":"firebase emulators:start --only firestore","lint":"npx eslint ./src --max-warnings 0","test":"npm run test:build && npm run test:unit && npm run test:int && npm run test:e2e","test:build":"npm run build && jest test/build.test.ts --coverageThreshold '{}' && rm -rf dist","test:e2e":"firebase emulators:exec 'npm run build && jest -c jest.e2e.config.ts test/FirestoreSaver.e2e.test.ts'","test:int":"firebase emulators:exec 'jest test/FirestoreSaver.int.test.ts --runInBand'","test:unit":"jest test/FirestoreSaver.unit.test.ts --runInBand"},"keywords":["langgraph","firestore","langgraph-checkpoint"],"author":{"name":"Bernardo Cassina"},"license":"MIT","dependencies":{"@google-cloud/firestore":"^7.11.3"},"peerDependencies":{"@langchain/core":">=0.2.31 <0.4.0","@langchain/langgraph-checkpoint":"^0.1.0"},"devDependencies":{"@commitlint/cli":"^19.8.1","@commitlint/config-conventional":"^19.8.1","@eslint/js":"^9.32.0","@firebase/rules-unit-testing":"^5.0.0","@langchain/langgraph":"^0.4.1","@langchain/openai":"^0.6.3","@types/jest":"^30.0.0","@types/node":"^24.1.0","dotenv":"^16.0.3","eslint":"^9.32.0","firebase-admin":"^13.4.0","firebase-tools":"^14.11.1","husky":"^9.1.7","jest":"^30.0.5","ts-jest":"^29.4.0","ts-node":"^10.9.2","tsup":"^8.5.0","typescript":"^5.8.3","typescript-eslint":"^8.38.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_id":"@cassina/langgraphjs-checkpoint-firestore@1.0.0","gitHead":"c9235ad0b0e8d5771ed333a7cf04a92cf449dfa8","bugs":{"url":"https://github.com/cassina/langgraphjs-checkpoint-firestore/issues"},"homepage":"https://github.com/cassina/langgraphjs-checkpoint-firestore#readme","_nodeVersion":"22.12.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-3i98gZEjh324evNi/xH/l+ouTD3Oglw406SmropIe7TToNb+cXqTQvN5kvTWqEGOIhSFFCj+cOW0N+nKzBah8A==","shasum":"aa7a84cfc3a52c8728021f1ca3591d52327c6f08","tarball":"https://registry.npmjs.org/@cassina/langgraphjs-checkpoint-firestore/-/langgraphjs-checkpoint-firestore-1.0.0.tgz","fileCount":9,"unpackedSize":63822,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHaIO/RwAlPpi19fXx0auHO6nrTBYPTOZydA5ZQO7Z33AiBe566nmy10mK8+9rxJ5Meu4Oq/brtQWLzDhatB4dTfRQ=="}]},"_npmUser":{"name":"cassina","email":"bernardocassina@gmail.com"},"directories":{},"maintainers":[{"name":"cassina","email":"bernardocassina@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/langgraphjs-checkpoint-firestore_1.0.0_1754343726369_0.18387233410378023"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-04T21:42:06.289Z","1.0.0":"2025-08-04T21:42:06.549Z","modified":"2025-08-04T21:42:06.801Z"},"maintainers":[{"name":"cassina","email":"bernardocassina@gmail.com"}],"description":"LangGraph.js Checkpoint implementation for Firestore","homepage":"https://github.com/cassina/langgraphjs-checkpoint-firestore#readme","keywords":["langgraph","firestore","langgraph-checkpoint"],"repository":{"type":"git","url":"git+ssh://git@github.com/cassina/langgraphjs-checkpoint-firestore.git"},"author":{"name":"Bernardo Cassina"},"bugs":{"url":"https://github.com/cassina/langgraphjs-checkpoint-firestore/issues"},"license":"MIT","readme":"# LangGraphJS Firestore Checkpoint\n\n[![npm version](https://img.shields.io/npm/v/@cassina/langgraphjs-checkpoint-firestore)](https://www.npmjs.com/package/@cassina/langgraphjs-checkpoint-firestore)\n[![CI](https://github.com/cassina/langgraphjs-checkpoint-firestore/actions/workflows/ci.yml/badge.svg)](https://github.com/cassina/langgraphjs-checkpoint-firestore/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.md)\n\n## Introduction\n\n**LangGraphJS Firestore Checkpoint** is a Firestore backed checkpoint saver for [LangGraphJS](https://github.com/langchain-ai/langgraphjs). It allows you to persist and restore LangChain workflow state in Google Firestore, making it easy to resume executions or share state between processes.\n\n## Installation\n\n```bash\nnpm install @cassina/langgraphjs-checkpoint-firestore\n```\n\n## Usage\n\n1. **Initialize Firebase Admin and Firestore**\n   ```typescript\n   import { initializeApp, cert } from 'firebase-admin/app';\n   import { getFirestore } from 'firebase-admin/firestore';\n   import { FirestoreSaver } from '@cassina/langgraphjs-checkpoint-firestore';\n\n   initializeApp();\n\n   const firestore = getFirestore();\n   const saver = new FirestoreSaver({ firestore });\n   ```\n\n2. **Save and retrieve a checkpoint**\n   ```typescript\n   const config = { configurable: { thread_id: 'my-thread' } };\n\n   // Save workflow state\n   await saver.put(config, checkpointData, metadata);\n\n   // Later restore\n   const tuple = await saver.getTuple(config);\n   if (tuple) {\n     console.log('Restored checkpoint', tuple.checkpoint);\n   }\n   ```\n\n`FirestoreSaver` uses two collections by default: `checkpoints` and `checkpoint_writes`. You can override them:\n\n```typescript\nconst saver = new FirestoreSaver({\n  firestore,\n  checkpointCollectionName: 'my_checkpoints',\n  checkpointWritesCollectionName: 'my_writes',\n});\n```\n\nThe saver can be plugged directly into a LangGraph/LangChain workflow or used on its own to persist state between runs like so:\n\n```typescript\nconst workflow = new StateGraph(StateAnnotation)\n        .addNode('agent', callModel)\n        .addEdge(START, 'agent');\n\nconst app = workflow.compile({\n   checkpointer: saver,\n});\n```\n\n- Please see `test/FirestoreSaver.e2e.test.ts` for a full example.\n\n| Method           | Purpose                                                              | Signature(key params only)                                                                               | Return                                                     |\n|------------------|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|------------------------------------------------------------|\n| **constructor**  | Create a saver bound to Firestore collections.                       | `new FirestoreSaver({ firestore, checkpointCollectionName? , checkpointWritesCollectionName? }, serde?)` | `FirestoreSaver`                                           |\n| **put**          | Persist a checkpoint and its metadata.                               | `put(config, checkpoint, metadata)`                                                                      | `Promise<RunnableConfig>` (points at the saved checkpoint) |\n| **getTuple**     | Fetch the latest (or specific) checkpoint plus its pending writes.   | `getTuple(config)`                                                                                       | `Promise<CheckpointTuple \\| undefined>`                    |\n| **list**         | Stream checkpoints that match a config, optionally filtered/limited. | `list(config, options?)`                                                                                 | `AsyncGenerator<CheckpointTuple>`                          |\n| **putWrites**    | Record pending-write entries for a task.                             | `putWrites(config, writes, taskId)`                                                                      | `Promise<void>`                                            |\n| **deleteThread** | Remove every checkpoint and write belonging to a thread.             | `deleteThread(threadId)`                                                                                 | `Promise<void>`                                            |\n\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE.md](LICENSE.md) for the full text.\n","readmeFilename":"README.md","_rev":"1-0af9bf11157cd57dc5a23f64af1f52fa"}