{"_id":"@curiouslycory/memai-sdk","_rev":"2-b69721583bacbb0897b264e9ae56acec","name":"@curiouslycory/memai-sdk","dist-tags":{"beta":"0.1.0-beta.1","latest":"0.1.0-beta.11"},"versions":{"0.1.0-beta.1":{"name":"@curiouslycory/memai-sdk","version":"0.1.0-beta.1","keywords":["mem.ai","sdk","api","client","typescript"],"author":{"url":"Curiously","email":"cory@curiouslycory.com"},"license":"MIT","_id":"@curiouslycory/memai-sdk@0.1.0-beta.1","maintainers":[{"name":"curiouslycorydev","email":"cory@curiouslycory.com"}],"homepage":"https://github.com/CuriouslyCory/memai-sdk","bugs":{"url":"https://github.com/CuriouslyCory/memai-sdk/issues"},"dist":{"shasum":"198f7c8fd570b58a83a428e9919bbc0aa5a6aeb0","tarball":"https://registry.npmjs.org/@curiouslycory/memai-sdk/-/memai-sdk-0.1.0-beta.1.tgz","fileCount":15,"integrity":"sha512-jPZE0XZ518U6uMEeVfEAHFQGCTe4l0DPCajGXI9QTzsRdr5j6Ezz0MyIAEEhVx3TeE5YLrhexsOIxOGQ6NgK1w==","signatures":[{"sig":"MEUCIQDtX/j+kKn9QE/YtDk0phpoN4GTu83Xgax6+7USr1Tu4AIgZdH/wRvx0WoxGrQ08w/TrYz52iH3DNTHCqmnjwbpUEE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58200},"main":"dist/index.js","type":"module","_from":"file:curiouslycory-memai-sdk-0.1.0-beta.1.tgz","types":"dist/index.d.ts","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"private":false,"scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest","build":"tsc","clean":"rimraf dist","format":"prettier --write \"src/**/*.ts\"","lint:fix":"eslint src --ext .ts --fix","type-check":"tsc --noEmit","format:check":"prettier --check \"src/**/*.ts\""},"_npmUser":{"name":"curiouslycorydev","email":"cory@curiouslycory.com"},"_resolved":"/tmp/924fb98c935eba386deb5d48b4ccffbb/curiouslycory-memai-sdk-0.1.0-beta.1.tgz","_integrity":"sha512-jPZE0XZ518U6uMEeVfEAHFQGCTe4l0DPCajGXI9QTzsRdr5j6Ezz0MyIAEEhVx3TeE5YLrhexsOIxOGQ6NgK1w==","repository":{"url":"git+https://github.com/CuriouslyCory/memai-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"TypeScript SDK for the mem.ai REST API","directories":{},"_nodeVersion":"22.15.0","dependencies":{"cross-fetch":"^4.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.26.0","rimraf":"^6.0.1","ts-jest":"^29.3.3","prettier":"^3.5.3","@eslint/js":"^9.26.0","typescript":"^5.8.3","@types/jest":"^29.5.14","@types/node":"^22.15.18","@jest/globals":"^29.7.0","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.4.0","@typescript-eslint/parser":"^8.32.1","@typescript-eslint/eslint-plugin":"^8.32.1"},"_npmOperationalInternal":{"tmp":"tmp/memai-sdk_0.1.0-beta.1_1747269002683_0.3246069241185132","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-beta.11":{"name":"@curiouslycory/memai-sdk","version":"0.1.0-beta.11","description":"TypeScript SDK for the mem.ai REST API","private":false,"publishConfig":{"access":"public"},"type":"module","main":"dist/index.js","types":"dist/index.d.ts","keywords":["mem.ai","sdk","api","client","typescript"],"author":{"email":"cory@curiouslycory.com","url":"Curiously"},"license":"MIT","engines":{"node":">=14.0.0"},"repository":{"type":"git","url":"git+https://github.com/CuriouslyCory/memai-sdk.git"},"homepage":"https://github.com/CuriouslyCory/memai-sdk","bugs":{"url":"https://github.com/CuriouslyCory/memai-sdk/issues"},"devDependencies":{"@easyops-cn/docusaurus-search-local":"^0.49.2","@eslint/js":"^9.26.0","@jest/globals":"^29.7.0","@types/jest":"^29.5.14","@types/node":"^22.15.18","@typescript-eslint/eslint-plugin":"^8.32.1","@typescript-eslint/parser":"^8.32.1","docusaurus-plugin-typedoc":"^1.4.0","eslint":"^9.26.0","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.4.0","jest":"^29.7.0","prettier":"^3.5.3","rimraf":"^6.0.1","ts-jest":"^29.3.3","typedoc":"^0.28.4","typedoc-plugin-markdown":"^4.6.3","typescript":"^5.8.3"},"dependencies":{"cross-fetch":"^4.1.0"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"pnpm run docs:api && tsc","clean":"rimraf dist","dev":"tsc --watch","test":"NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest","lint":"eslint src --ext .ts","lint:fix":"eslint src --ext .ts --fix","format":"prettier --write \"src/**/*.ts\"","format:check":"prettier --check \"src/**/*.ts\"","type-check":"tsc --noEmit","docs:api":"typedoc"},"_id":"@curiouslycory/memai-sdk@0.1.0-beta.11","_integrity":"sha512-0aBPJ9r7djg4YMATPGiEv623If55oIlxWbZNv8Suaf/CW/kgyYqpa1UKSEnMr/8CF8Gp1y2afgfo0PqKZNnL9g==","_resolved":"/tmp/7cfd3ba679c713b786f636a0c413b0e9/curiouslycory-memai-sdk-0.1.0-beta.11.tgz","_from":"file:curiouslycory-memai-sdk-0.1.0-beta.11.tgz","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-0aBPJ9r7djg4YMATPGiEv623If55oIlxWbZNv8Suaf/CW/kgyYqpa1UKSEnMr/8CF8Gp1y2afgfo0PqKZNnL9g==","shasum":"f1b1a7c061f3bbc7980d9c544bb6245363e9da6e","tarball":"https://registry.npmjs.org/@curiouslycory/memai-sdk/-/memai-sdk-0.1.0-beta.11.tgz","fileCount":15,"unpackedSize":58403,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGYIzadNOvUnHV68DYbJj1b/1THh80uiV2NvrTgU1ROGAiBtpWcf8ZSe/UcM+KAvVzgU7ajPAHnRcptL6s6as3CTQA=="}]},"_npmUser":{"name":"curiouslycorydev","email":"cory@curiouslycory.com"},"directories":{},"maintainers":[{"name":"curiouslycorydev","email":"cory@curiouslycory.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/memai-sdk_0.1.0-beta.11_1747280416841_0.5325242155066969"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-15T00:30:02.577Z","modified":"2025-05-15T03:40:17.228Z","0.1.0-beta.1":"2025-05-15T00:30:02.863Z","0.1.0-beta.11":"2025-05-15T03:40:17.027Z"},"bugs":{"url":"https://github.com/CuriouslyCory/memai-sdk/issues"},"author":{"email":"cory@curiouslycory.com","url":"Curiously"},"license":"MIT","homepage":"https://github.com/CuriouslyCory/memai-sdk","keywords":["mem.ai","sdk","api","client","typescript"],"repository":{"type":"git","url":"git+https://github.com/CuriouslyCory/memai-sdk.git"},"description":"TypeScript SDK for the mem.ai REST API","maintainers":[{"name":"curiouslycorydev","email":"cory@curiouslycory.com"}],"readme":"# @curiouslycory/memai-sdk\n\n[![npm version](https://badge.fury.io/js/%40curiouslycory%2Fmemai-sdk.svg)](https://badge.fury.io/js/%40curiouslycory%2Fmemai-sdk)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Build Status](https://github.com/CuriouslyCory/memai-sdk/actions/workflows/main.yml/badge.svg)](https://github.com/CuriouslyCory/memai-sdk/actions/workflows/main.yml)\n\nA TypeScript SDK for interacting with the [Mem.ai REST API](https://mem.ai), providing an easy-to-use, type-safe interface for programmatically managing your mems. Find the [full documentation here](https://memai-sdk.curiouslycory.com)\n\n## Features\n\n- **Type-Safe**: Fully written in TypeScript for a better developer experience.\n- **Modern JavaScript**: Uses ES modules and modern JavaScript features.\n- **API Coverage**: Designed to cover core Mem.ai API functionality like `memIt`, `createNote`, and `deleteNote`.\n- **Error Handling**: Includes custom error types for robust error management.\n- **Retry Logic**: Built-in retry mechanism for transient network errors and rate limits.\n\n## Installation\n\nInstall the package using your preferred package manager:\n\n```bash\n# PNPM\npnpm add @curiouslycory/memai-sdk\n\n# NPM\nnpm install @curiouslycory/memai-sdk\n\n# Yarn\nyarn add @curiouslycory/memai-sdk\n```\n\n## API Key\n\nTo use this SDK, you need a Mem.ai API key. You can obtain your API key from your Mem account settings page on the Mem.ai website. Keep your API key secure and do not expose it in client-side code.\n\n## Quick Start\n\nHere\\'s a quick example to get you started:\n\n```typescript\nimport { MemClient, MemApiError } from '@curiouslycory/memai-sdk';\n\n// Initialize the client with your API key\n// Replace 'YOUR_MEM_API_KEY' with your actual key\nconst client = new MemClient('YOUR_MEM_API_KEY');\n\nasync function createMyNote() {\n  try {\n    const newNote = await client.createNote({\n      content: '# My First Note\\nHello from the @curiouslycory/memai-sdk!',\n      auto_organize: \"Add to my 'SDK Tests' collection\",\n    });\n    console.log('Note Created Successfully!');\n    console.log('ID:', newNote.id);\n    console.log('Title:', newNote.title);\n    console.log('URL:', newNote.url);\n    console.log('Content:', newNote.content);\n  } catch (error) {\n    if (error instanceof MemApiError) {\n      console.error(`Mem API Error (${error.statusCode}): ${error.message}`);\n      // You can check for specific error types\n      // if (error instanceof RateLimitError) { ... }\n    } else {\n      console.error('An unexpected error occurred:', error);\n    }\n  }\n}\n\ncreateMyNote();\n```\n\n## Core Features\n\nThis SDK provides convenient methods to interact with the Mem.ai API:\n\n- **`memIt(payload)`**: A versatile endpoint to send various types of content (text, HTML, URLs) to Mem with optional processing instructions.\n- **`createNote(options)`**: Directly creates a new note with specified content and organization options.\n- **`deleteNote(id)`**: Deletes a note by its ID.\n\nFor detailed information on parameters, return types, and specific error handling for each method, please refer to the TSDoc comments within the SDK code. Full API documentation generated from TSDoc will be available at [https://memai-sdk.curiouslycory.com](https://memai-sdk.curiouslycory.com).\n\n## Error Handling\n\nThe SDK throws custom errors that extend `MemApiError`. You can catch these errors and use `instanceof` to check for specific error types:\n\n```typescript\nimport { MemClient, MemApiError, RateLimitError, NotFoundError } from \\'@curiouslycory/memai-sdk\\';\n\nconst client = new MemClient(\\'YOUR_MEM_API_KEY\\');\n\nasync function exampleOperation(noteId: string) {\n  try {\n    await client.deleteNote(noteId);\n    console.log(\\`Note ${noteId} deleted.\\`);\n  } catch (error) {\n    if (error instanceof NotFoundError) {\n      console.warn(\\`Note ${noteId} not found: ${error.message}\\`);\n    } else if (error instanceof RateLimitError) {\n      console.warn(\\`Rate limit exceeded. Try again in ${error.retryAfter} seconds.\\`);\n      // Implement retry logic here if desired\n    } else if (error instanceof MemApiError) {\n      console.error(\\`Mem API Error (${error.statusCode}): ${error.message}\\`);\n    } else {\n      console.error(\\'An unexpected error occurred:\\', error);\n    }\n  }\n}\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to open an issue or submit a pull request. (A more detailed `CONTRIBUTING.md` will be added later).\n\n## License\n\nThis SDK is licensed under the [MIT License](LICENSE).\n","readmeFilename":"README.md"}