{"id":15440683,"url":"https://github.com/erikbrinkman/rmapi-js","last_synced_at":"2025-04-12T21:52:53.271Z","repository":{"id":151223677,"uuid":"482901936","full_name":"erikbrinkman/rmapi-js","owner":"erikbrinkman","description":"JavaScript implementation of the reMarkable api","archived":false,"fork":false,"pushed_at":"2025-02-12T03:13:41.000Z","size":6564,"stargazers_count":41,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T16:24:41.298Z","etag":null,"topics":["remarkable-tablet","typescript"],"latest_commit_sha":null,"homepage":"https://erikbrinkman.github.io/rmapi-js/modules.html","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/erikbrinkman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-04-18T15:42:05.000Z","updated_at":"2025-03-07T17:45:56.000Z","dependencies_parsed_at":"2024-10-31T16:34:57.618Z","dependency_job_id":"f47f2aa7-fa9e-4b3e-a70c-1abf708e5f5c","html_url":"https://github.com/erikbrinkman/rmapi-js","commit_stats":{"total_commits":63,"total_committers":2,"mean_commits":31.5,"dds":"0.031746031746031744","last_synced_commit":"609e4cdd4e5cfcd1fb3ffb714acfb7d91493b3d3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikbrinkman%2Frmapi-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikbrinkman%2Frmapi-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikbrinkman%2Frmapi-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikbrinkman%2Frmapi-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erikbrinkman","download_url":"https://codeload.github.com/erikbrinkman/rmapi-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248263531,"owners_count":21074525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["remarkable-tablet","typescript"],"created_at":"2024-10-01T19:14:57.676Z","updated_at":"2025-04-12T21:52:53.250Z","avatar_url":"https://github.com/erikbrinkman.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# rmapi-js\n\n[![build](https://github.com/erikbrinkman/rmapi-js/actions/workflows/build.yml/badge.svg)](https://github.com/erikbrinkman/rmapi-js/actions/workflows/build.yml)\n[![docs](https://img.shields.io/badge/docs-docs-blue)](https://erikbrinkman.github.io/rmapi-js/modules.html)\n[![npm](https://img.shields.io/npm/v/rmapi-js)](https://www.npmjs.com/package/rmapi-js)\n[![license](https://img.shields.io/github/license/erikbrinkman/rmapi-js)](LICENSE)\n\nJavaScript implementation of the reMarkable api. It should also be pretty easy\nto customize to work with\n[rmfakecloud](https://github.com/ddvk/rmfakecloud), although that might take a\nlittle bit of extra plumbing.\n\n## API\n\nBefore using this API it's necessary to have some rudimentary understanding of\nhow the API works.\n\nAll data is stored via its sha256 hash. This includes raw files (\"documents\")\nand folders (\"collections\"). The hash indicates the full current state to manage simultaneous edits. Most entries or edits will take an input hash, and return an output hash. Additionally, every entry has an id, which is a uuid4, and remains constantant over the lifetime of the file or folder. There are two special ids, \"\" (the empty string) which corresponds to the root collection, e.g. the default location for all files, and \"trash\", which is the trash.\n\n## Usage\n\nTo explore files in the cloud, you need to first register your api and persist\nthe token. Then you can use `listFiles` to explore entries of different file\ncollections.\n\n```ts\nimport { register, remarkable } from \"rmapi-js\";\n\nconst code = \"...\"; // eight letter code from https://my.remarkable.com/device/desktop/connect\nconst token = await register(code);\n// persist token so you don't have to register again\nconst api = await remarkable(token);\nconst fileEntries = await api.listFiles();\n```\n\nTo upload an epub or pdf, simply call upload with the appropriate name and buffer.\n\n```ts\nimport { remarkable } from \"rmapi-js\";\n\nconst api = await remarkable(...);\nawait api.uploadEpub(\"name\", buffer);\nawait api.uploadPdf(\"name\", buffer);\n```\n\nThere are alos low level apis that more directly manipulate cloud storage.\nUsing these apis is a little riskier since they can potentially result in data loss, but it does come with increased flexibility.\n\n```ts\n// ...\n\n// upload with custom line height not avilable through reMarkable\nawait api.putEpub(\"name\", buffer, { lineHeight: 180 })\n\n// fetch an uploaded pdf, using the hash (from listFiles)\nconst buffer = await api.getEpub(hash)\n```\n\n### Gotchas\n\nBy default, all calls try to do their best to verify that the input and output\nmatches what I expect. However, since I reverse-engineered this, some of it\ncould be wrong. If you ever run into a `ValidationError` and know you want\nwhatever data is returned, You'll have to use the low-level api under `api.raw`\nto access the raw text file and parse the result yourself.\n\nIt seems that exporting happens within the apps themselves, which will require\nlayout of the remarkable file structure. That's currently outside the scope of\nthis project.\n\n## Users\n\n- [✉️ Send Via](https://sendvia.me/) [[github](https://github.com/PaulKinlan/send-to-remarkable)] - upload to reMarkable via email\n- [ⓡ rePub](https://chromewebstore.google.com/detail/repub/blkjpagbjaekkpojgcgdapmikoaolpbl) [[github](https://github.com/hafaio/repub)] - web clipper for reMarkable that supports images and customization\n- [reMarkable Digest](https://digest.ferrucc.io) - create and receive a daily digest on your reMarkable\n\n## Contributing\n\nSince this has all been reverse engineered, any help expanding the api would be\nhelpful. For example, There's currently a function to download the entire state\nof a document, but I ran into trouble trying to reupload that exact same file as\na clone.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikbrinkman%2Frmapi-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikbrinkman%2Frmapi-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikbrinkman%2Frmapi-js/lists"}