You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 15, 2025. It is now read-only.
Unofficial reMarkable api wrapper for node.js based on these unofficial docs.
This module is typed for TypeScript, but you can still use JavaScript with it.
Installation
yarn add remarkable-typescript
# OR
npm install remarkable-typescript
Then, go to reMarkable's website to genereate a code to pair your reMarkable. This code is only available 5 minutes.
Example
import{Remarkable,ItemResponse}from'remarkable-typescript';// const { Remarkable, ItemResponse } = require('remarkable-typescript');constfs=require('fs');(async()=>{/* * Create the reMarkable client * Params: { deviceToken?: string } * Returns: client: Remarkable */constclient=newRemarkable();/* * Register your reMarkable and generate a device token. You must do this first to pair your device if you didn't specify a token. This may take a few seconds to complete. It seems that the deviceToken never expires. * Params: { code: string } * Returns: deviceToken: string */constdeviceToken=awaitclient.register({code: 'created code'});// (optional) skip registration in the future with `new Remarkable({deviceToken})`console.log(deviceToken);/* * (Re)generate a token from the deviceToken. You MUST call this function after creating the client. This token, used to interact with storage, is different from the deviceToken. This function is automatically called in register(). This token expires. * Params: none * Returns: token: string */awaitclient.refreshToken();/* * List all items, files and folders. * Params: none * Returns: ItemResponse[] */constitems=awaitclient.getAllItems();/* * Get an item by id * Params: id: string * Returns: ItemResponse | null */constitem=awaitclient.getItemWithId('some uuid');/* * Delete an item by is ID and document version * Params: id: string, version: number * Returns: success: boolean */awaitclient.deleteItem('some uuid',1);constmyPDF=fs.readFileSync('./my/PDF/location.pdf');/* * Upload a PDF to your reMarkable * Params: name: string, file: Buffer * Returns: id: string */constpdfUploadedId=awaitclient.uploadPDF('name of PDF document',ID: '181a124b-bbdf-4fdd-8310-64fa87bc9c7f',pdfFileBuffer,/*optional UUID of parent folder*/);/* * Download a ZIP file to your reMarkable (with the annotations) * Params: id: string * Returns: Buffer */constzipFile=awaitclient.downloadZip(pdfUploadedId);/* * Upload a ZIP file to your reMarkable (must be a supported reMarkable format). You can generate the ID using uuidv4. * Params: name: string, id: string, zipFile: Buffer * Returns: id: string */constzipFileId=awaitclient.uploadZip('My document name',ID: 'f831481c-7d2d-4776-922d-36e708d9d680',zipFile);/* * Upload an ePub file to your reMarkable (must be a supported reMarkable format). You can generate the ID using uuidv4 or v5. v5 will deterministically generate a uuid based on name and namespace . * Params: name: string, id: string, epubFileBuffer: Buffer, parent?: string * Returns: id: string */constepubDocId=awaitclient.uploadEPUB('name of ePub document',ID: '181a124b-bbdf-4fdd-8310-64fa87bc9c7f',epubFileBuffer,/*optional UUID of parent folder*/);/* * Create a directory * Params: name: string, id: string, epubFileBuffer: Buffer, parent?: string * Returns: id: string */constdirectoryId=awaitclient.createDirectory('testDir2',id,ID: '702ba145-0a78-4e19-9324-6f8fb3da3c1a',/*optional UUID of parent folder*/);})();