{"_id":"@cogniradar/client-sdk","name":"@cogniradar/client-sdk","dist-tags":{"stable":"0.3.92-my.1","latest":"0.3.92-my.1"},"versions":{"0.3.92-my.1":{"name":"@cogniradar/client-sdk","type":"module","version":"0.3.92-my.1","description":"TypeScript client SDK for Follow RSS Server API","license":"MIT","keywords":["follow","rss","client","sdk","typescript","folo","api","ai"],"exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./auth":{"import":"./dist/auth.js","require":"./dist/auth.cjs"},"./models":{"import":"./dist/models/index.js","require":"./dist/models/index.cjs"}},"main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@folo-services/constants":"0.1.53","@folo-services/drizzle":"0.1.44","@folo-services/exceptions":"0.1.28","@folo-services/shared":"0.0.44","better-auth":"1.3.28","zod":"4.1.12"},"devDependencies":{"@types/node":"24.10.0","drizzle-orm":"0.44.7","tsdown":"0.15.9","typescript":"5.9.3","vitest":"3.2.4"},"x-code-hash":"3ff5cc878ed9f89670e46365200a43748ad2a65963b6964f50bca08e2f701c74","scripts":{"build":"pnpm run build:auth && tsdown","build:auth":"tsdown -c tsdown.auth.config.ts","clean":"rm -rf dist","lint":"eslint src --ext .ts,.tsx","lint:fix":"eslint src --ext .ts,.tsx --fix","publish:packages":"pnpm publish --no-git-checks --access public","test":"CI=true vitest","test:watch":"vitest --watch","typecheck":"tsgo --noEmit"},"_id":"@cogniradar/client-sdk@0.3.92-my.1","_nodeVersion":"22.16.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-bMT6e56Y6UXK1y355NcY6WisaP7F/sPod7RiuQYY8hzYQ1qgw5L0jsTVoUCV2mvedvUB7XKu0kGmRvCHNqQTJQ==","shasum":"e1c9b496190d28c429819ed5649330bcaba7d7d5","tarball":"https://registry.npmjs.org/@cogniradar/client-sdk/-/client-sdk-0.3.92-my.1.tgz","fileCount":110,"unpackedSize":781856,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDvIe5fA4unG3w0jeOFofGO9IcICfUd+RDsvtslmGXpxQIgWv2CyaLQ1ATesM0MzyxvMlRXCRIcFnLiRLj1/jk84mY="}]},"_npmUser":{"name":"jianghaiyang","email":"jianghaiyangcc@gmail.com"},"directories":{},"maintainers":[{"name":"jianghaiyang","email":"jianghaiyangcc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/client-sdk_0.3.92-my.1_1778718121965_0.6390988720742894"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-14T00:22:01.842Z","0.3.92-my.1":"2026-05-14T00:22:02.130Z","modified":"2026-05-14T00:22:02.431Z"},"maintainers":[{"name":"jianghaiyang","email":"jianghaiyangcc@gmail.com"}],"description":"TypeScript client SDK for Follow RSS Server API","keywords":["follow","rss","client","sdk","typescript","folo","api","ai"],"license":"MIT","readme":"# Folo Client SDK\n\nThe official JavaScript/TypeScript client for Folo - the modern RSS reader. This SDK makes it easy to build applications that interact with Folo's RSS management, reading history, and AI-powered features.\n\n## Why Use the Folo SDK?\n\n- **Cross-Platform**: Works in browsers, Node.js, React Native, and other JavaScript environments\n- **Type-Safe**: Full TypeScript support with auto-completion and error prevention\n- **Production Ready**: Used by Folo's official apps with comprehensive error handling\n\n## Installation\n\n```bash\npnpm add @follow-app/client-sdk\n```\n\n## Quick Start\n\n```typescript\nimport { FollowClient } from '@follow-app/client-sdk'\n\n// Connect to Folo\nconst follow = new FollowClient({\n  baseURL: 'https://api.follow.is',\n  credentials: 'include', // For web apps\n})\n\n// Subscribe to an RSS feed\nawait follow.subscriptions.create({\n  url: 'https://example.com/rss',\n  category: 'Technology',\n})\n\n// Get your latest unread articles\nconst articles = await follow.entries.list({\n  read: false,\n  limit: 20,\n})\n\n// Mark articles as read\nawait follow.entries.batch.read({\n  entryIds: articles.data.map((entry) => entry.id),\n})\n```\n\n## Core Features\n\n### 📰 Feed Management\n\nSubscribe to and manage RSS feeds with ease:\n\n```typescript\n// Subscribe to feeds\nawait follow.subscriptions.create({\n  url: 'https://blog.example.com/rss',\n  category: 'Tech Blogs',\n})\n\n// Get all your subscriptions\nconst subscriptions = await follow.subscriptions.get()\n\n// Import OPML files\nawait follow.subscriptions.import({ opmlContent })\n```\n\n### 📖 Reading Experience\n\nTrack and manage your reading:\n\n```typescript\n// Get unread articles\nconst unread = await follow.entries.list({\n  read: false,\n  limit: 50,\n})\n\n// Mark articles as read\nawait follow.entries.batch.read({\n  entryIds: ['article-1', 'article-2'],\n})\n\n// Save articles to inbox\nawait follow.entries.inbox.add({\n  entryId: 'article-123',\n  note: 'Read later',\n})\n```\n\n### 🤖 AI-Powered Features\n\nEnhance your reading with AI:\n\n```typescript\n// Get article summaries\nconst summary = await follow.ai.summary({\n  id: 'article-123',\n})\n\n// Chat with AI about your articles\nconst response = await follow.ai.chat({\n  messages: [\n    { role: 'user', content: 'What are the key trends in this article?' },\n  ],\n})\n\n// Get personalized recommendations\nconst recommendations = await follow.ai.recommendations()\n```\n\n### 📊 Analytics & Insights\n\nUnderstand your reading habits:\n\n```typescript\n// Get reading statistics\nconst stats = await follow.reads.stats()\n\n// Track feed performance\nconst feedAnalytics = await follow.feeds.analytics({\n  feedId: 'feed-123',\n})\n```\n\n## Setup & Configuration\n\n### For Web Applications\n\n```typescript\nimport { FollowClient } from '@follow-app/client-sdk'\n\nconst follow = new FollowClient({\n  baseURL: 'https://api.follow.is',\n  credentials: 'include', // For cookie-based authentication\n})\n```\n\n### For Node.js Applications\n\n```typescript\nimport { FollowClient } from '@follow-app/client-sdk'\n\nconst follow = new FollowClient({\n  baseURL: 'https://api.follow.is',\n  headers: {\n    Authorization: 'Bearer your-api-token',\n  },\n})\n\n// Or set the token later\nfollow.setAuthToken('your-api-token')\n```\n\n### For React Native\n\n```typescript\nimport { FollowClient } from '@follow-app/client-sdk'\n\nconst follow = new FollowClient({\n  baseURL: 'https://api.follow.is',\n  credentials: 'include',\n  headers: {\n    'User-Agent': 'YourApp/1.0.0',\n  },\n})\n```\n\n## Error Handling\n\nThe SDK provides clear error handling for common scenarios:\n\n```typescript\nimport { FollowAPIError, FollowAuthError } from '@follow-app/client-sdk'\n\ntry {\n  const articles = await follow.entries.list()\n} catch (error) {\n  if (error instanceof FollowAuthError) {\n    // User needs to log in\n    console.log('Authentication required')\n    redirectToLogin()\n  } else if (error instanceof FollowAPIError) {\n    // Handle API errors (network, server, etc.)\n    console.log(`Error: ${error.message}`)\n    showErrorMessage(error.message)\n  }\n}\n```\n\n### Specific Error Codes\n\n```typescript\nimport { ExceptionCodeMap } from '@follow-app/client-sdk'\n\ntry {\n  await follow.subscriptions.create({ url: 'invalid-url' })\n} catch (error) {\n  if (error.code === ExceptionCodeMap.feed.NOT_FOUND) {\n    console.log('Feed not found at that URL')\n  } else if (error.code === ExceptionCodeMap.subscription.ALREADY_EXISTS) {\n    console.log('You are already subscribed to this feed')\n  }\n}\n```\n\n## Common Use Cases\n\n### Building a Personal RSS Reader\n\n```typescript\n// Set up the client\nconst follow = new FollowClient({\n  baseURL: 'https://api.follow.is',\n  credentials: 'include',\n})\n\n// Subscribe to feeds\nawait follow.subscriptions.create({\n  url: 'https://blog.openai.com/rss/',\n  category: 'AI & Technology',\n})\n\n// Get latest articles\nconst latest = await follow.entries.list({\n  read: false,\n  limit: 20,\n})\n\n// Display articles to user, then mark as read\nawait follow.entries.batch.read({\n  entryIds: latest.data.map((article) => article.id),\n})\n```\n\n### Content Curation Tool\n\n```typescript\n// Import existing OPML subscription list\nawait follow.subscriptions.import({ opmlContent })\n\n// Get articles from specific categories\nconst techNews = await follow.entries.list({\n  category: 'Technology',\n  limit: 100,\n  read: false,\n})\n\n// Filter by keywords\nconst aiArticles = techNews.data.filter(\n  (article) =>\n    article.title.toLowerCase().includes('ai') ||\n    article.content.toLowerCase().includes('artificial intelligence'),\n)\n\n// Save important articles to inbox\nfor (const article of aiArticles) {\n  await follow.entries.inbox.add({\n    entryId: article.id,\n    note: 'AI trend research',\n  })\n}\n```\n\n### AI-Enhanced Reading App\n\n```typescript\n// Get user's reading recommendations\nconst recommendations = await follow.ai.chat({\n  messages: [\n    {\n      role: 'user',\n      content: 'What are the most important articles I should read today?',\n    },\n  ],\n})\n\n// Get summary of long articles\nconst longArticles = await follow.entries.list({\n  read: false,\n  limit: 10,\n})\n\nfor (const article of longArticles.data) {\n  const summary = await follow.ai.summary({\n    id: article.id,\n  })\n\n  console.log(`${article.title}\\nSummary: ${summary.summary}`)\n}\n```\n\n## License\n\nMIT License - see [LICENSE](./LICENSE) file for details.\n\n## Contributing\n\nWe welcome contributions! Please see our [contributing guide](https://github.com/RSSNext/folo/blob/main/CONTRIBUTING.md) for details on:\n\n- Setting up the development environment\n- Running tests and linting\n- Submitting pull requests\n- Code style guidelines\n\n---\n\nMade with ❤️ by the [Folo](https://follow.is) team\n","readmeFilename":"README.md","_rev":"1-5b8c63d8ec2a51dea76e322510e763db"}