Optional
causeOptional
stackStatic
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
an error that results from a failed request
-Optional
causeOptional
stackReadonly
statusthe response status number
-Readonly
statusthe response status text
-Static
Optional
prepareOptional override for formatting stack traces
-Static
stackStatic
captureGenerated using TypeDoc
an error that results from a failed request
+Optional
causeOptional
stackReadonly
statusthe response status number
+Readonly
statusthe response status text
+Static
Optional
prepareOptional override for formatting stack traces
+Static
stackStatic
captureGenerated using TypeDoc
format an entry
-Generated using TypeDoc
format an entry
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
register a device and get the token needed to access the api
+register a device and get the token needed to access the api
Have users go to https://my.remarkable.com/device/browser/connect
and pass
the resulting code into this function to get a device token. Persist that
token to use the api.
the eight letter code a user got from https://my.remarkable.com/device/browser/connect
.
the device token necessary for creating an api instace. These never expire so persist as long as necessary.
- -Generated using TypeDoc
the eight letter code a user got from https://my.remarkable.com/device/browser/connect
.
the device token necessary for creating an api instace. These never expire so persist as long as necessary.
+Generated using TypeDoc
create an instance of the api
+create an instance of the api
This gets a temporary authentication token with the device token. If requests start failing, simply recreate the api instance.
-the device token proving this api instance is +
the device token proving this api instance is registered. Create one with register.
-an api instance
- -Generated using TypeDoc
an api instance
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
fields common to all MetadataEntries
-the hash of the entry
-the document id of the entry
-Generated using TypeDoc
fields common to all MetadataEntries
+the hash of the entry
+the document id of the entry
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
a remarkable entry for a cloud collection
-the unique id of the collection
-the hash of the collection this points to
-collections don't have sizes
-the number of subfiles
-collection type
-Generated using TypeDoc
a remarkable entry for a cloud collection
+the unique id of the collection
+the hash of the collection this points to
+collections don't have sizes
+the number of subfiles
+collection type
+Generated using TypeDoc
the metadata entry for a collection
-Optional
deletedif file is deleted
-the hash of the entry
-the document id of the entry
-last modified time
-Optional
metadatamodifiedunknown significance
-Optional
modifiedunknown significance
-Optional
parentparent uuid (documentId) or "" for root or "trash"
-Optional
pinnedunknown significance
-Optional
syncedunknown significance
-the key for collection types
-Optional
versionunknown significance
-name of content
-Generated using TypeDoc
the metadata entry for a collection
+Optional
deletedif file is deleted
+the hash of the entry
+the document id of the entry
+Optional
lastlast modified time
+Optional
metadatamodifiedunknown significance
+Optional
modifiedunknown significance
+Optional
parentparent uuid (documentId) or "" for root or "trash"
+Optional
pinnedunknown significance
+Optional
syncedunknown significance
+the key for collection types
+Optional
versionunknown significance
+name of content
+Generated using TypeDoc
metadata for collection types
-Optional
deletedif file is deleted
-last modified time
-Optional
metadatamodifiedunknown significance
-Optional
modifiedunknown significance
-Optional
parentparent uuid (documentId) or "" for root or "trash"
-Optional
pinnedunknown significance
-Optional
syncedunknown significance
-the key for collection types
-Optional
versionunknown significance
-name of content
-Generated using TypeDoc
metadata for collection types
+Optional
deletedif file is deleted
+Optional
lastlast modified time
+Optional
metadatamodifiedunknown significance
+Optional
modifiedunknown significance
+Optional
parentparent uuid (documentId) or "" for root or "trash"
+Optional
pinnedunknown significance
+Optional
syncedunknown significance
+the key for collection types
+Optional
versionunknown significance
+name of content
+Generated using TypeDoc
common metadata for documents and collections
-Optional
deletedif file is deleted
-last modified time
-Optional
metadatamodifiedunknown significance
-Optional
modifiedunknown significance
-Optional
parentparent uuid (documentId) or "" for root or "trash"
-Optional
pinnedunknown significance
-Optional
syncedunknown significance
-Optional
versionunknown significance
-name of content
-Generated using TypeDoc
common metadata for documents and collections
+Optional
deletedif file is deleted
+Optional
lastlast modified time
+Optional
metadatamodifiedunknown significance
+Optional
modifiedunknown significance
+Optional
parentparent uuid (documentId) or "" for root or "trash"
+Optional
pinnedunknown significance
+Optional
syncedunknown significance
+Optional
versionunknown significance
+name of content
+Generated using TypeDoc
content metadata
+content metadata
This is found in the .content
file.
number to use for the coverage page, -1 for last opened
-Optional
documentdocument metadata
-is this a dummy document
-extra metadata
-file type
-Optional
fontfont
-format version
-last opened page
-line height
-page margins in points
-Optional
orientationorientation
-number of pages
-page ids
-Optional
texttext alignment
-text scale
-Optional
transformpage transform
-Generated using TypeDoc
number to use for the coverage page, -1 for last opened
+Optional
documentdocument metadata
+is this a dummy document
+extra metadata
+file type
+Optional
fontfont
+format version
+last opened page
+line height
+page margins in points
+Optional
orientationorientation
+number of pages
+page ids
+Optional
texttext alignment
+text scale
+Optional
transformpage transform
+Generated using TypeDoc
options for create
and
+
Optional
cachewhether to use the last known valid root hash
-true
-Optional
syncwhether broadcast syncing complete to other devices
-true
-Generated using TypeDoc
Optional
cachewhether to use the last known valid root hash
+true
+
+Optional
syncwhether broadcast syncing complete to other devices
+true
+
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
the metadata entry for a document
-Optional
deletedif file is deleted
-the type of the document
-the hash of the entry
-the document id of the entry
-last modified time
-Optional
lastlast opened time for documents
-Optional
lastlast opened page for documents
-Optional
metadatamodifiedunknown significance
-Optional
modifiedunknown significance
-Optional
parentparent uuid (documentId) or "" for root or "trash"
-Optional
pinnedunknown significance
-Optional
syncedunknown significance
-the key for document types
-Optional
versionunknown significance
-name of content
-Generated using TypeDoc
the metadata entry for a document
+Optional
createdcreated time
+Optional
deletedif file is deleted
+the type of the document
+the hash of the entry
+the document id of the entry
+Optional
lastlast modified time
+Optional
lastlast opened time for documents
+Optional
lastlast opened page for documents
+Optional
metadatamodifiedunknown significance
+Optional
modifiedunknown significance
+Optional
parentparent uuid (documentId) or "" for root or "trash"
+Optional
pinnedunknown significance
+Optional
syncedunknown significance
+the key for document types
+Optional
versionunknown significance
+name of content
+Generated using TypeDoc
metadata for document types
-Optional
deletedif file is deleted
-last modified time
-Optional
lastlast opened time for documents
-Optional
lastlast opened page for documents
-Optional
metadatamodifiedunknown significance
-Optional
modifiedunknown significance
-Optional
parentparent uuid (documentId) or "" for root or "trash"
-Optional
pinnedunknown significance
-Optional
syncedunknown significance
-the key for document types
-Optional
versionunknown significance
-name of content
-Generated using TypeDoc
metadata for document types
+Optional
createdcreated time
+Optional
deletedif file is deleted
+Optional
lastlast modified time
+Optional
lastlast opened time for documents
+Optional
lastlast opened page for documents
+Optional
metadatamodifiedunknown significance
+Optional
modifiedunknown significance
+Optional
parentparent uuid (documentId) or "" for root or "trash"
+Optional
pinnedunknown significance
+Optional
syncedunknown significance
+the key for document types
+Optional
versionunknown significance
+name of content
+Generated using TypeDoc
stripped down version of fetch
-the rough interface to fetch
-Optional
options: RequestInitLikeGenerated using TypeDoc
stripped down version of fetch
+the rough interface to fetch
+Optional
options: RequestInitLikeGenerated using TypeDoc
a remarkable entry for cloud data
-the unique id of the file
-the hash of the file this points to
-size of the file
-files don't have subfiles
-file type
-Generated using TypeDoc
Generated using TypeDoc
options for getRootHash
Optional
cachewhether to use the last known valid root hash
-true
-Generated using TypeDoc
options for getRootHash
Optional
cachewhether to use the last known valid root hash
+true
+
+Generated using TypeDoc
stripped down version of Headers
-Generated using TypeDoc
Generated using TypeDoc
options for uploading an epub document
-Optional
coverwhich page should be shone as the cover
-Optional
fontthe font name, should probably come from builtinFontNames
Optional
lastthe tool to have enabled by default
-Optional
linethe height of lines
-Optional
marginsthe margins of the epub 180 is good for articles, 125 for books
-Optional
orientationthe page orientation
-Optional
parentthe parent id, default to root
-Optional
textthe text alignment
-Optional
textthe scale of text
-Generated using TypeDoc
options for uploading an epub document
+Optional
coverwhich page should be shone as the cover
+Optional
fontthe font name, should probably come from builtinFontNames
Optional
lastthe tool to have enabled by default
+Optional
linethe height of lines
+Optional
marginsthe margins of the epub 180 is good for articles, 125 for books
+Optional
orientationthe page orientation
+Optional
parentthe parent id, default to root
+Optional
textthe text alignment
+Optional
textthe scale of text
+Generated using TypeDoc
options for uploading a pdf
-Optional
coverwhich page should be shone as the cover
-Optional
lastthe tool to have enabled by default
-Optional
orientationthe page orientation
-Optional
parentthe parent id, default to root
-Generated using TypeDoc
options for uploading a pdf
+Optional
coverwhich page should be shone as the cover
+Optional
lastthe tool to have enabled by default
+Optional
orientationthe page orientation
+Optional
parentthe parent id, default to root
+Generated using TypeDoc
options for registering with the api
-Optional
authThe host to use for authorization requests
-Optional
devicethe device description to use
+options for registering with the api
+Optional
authThe host to use for authorization requests
+Optional
devicethe device description to use
Using an improper one will results in the registration being rejected.
-Optional
fetcha function for making fetch requests, see fetch for more info
-Optional
uuidthe unique id of this device
+Optional
fetcha function for making fetch requests, see RemarkableOptions.fetch for more info
+Optional
uuidthe unique id of this device
If omitted it will be randomly generated
-Generated using TypeDoc
Generated using TypeDoc
the api for accessing remarkable functions
-high level api to create an entry
+the api for accessing remarkable functions
+high level api to create an entry
After creating a collection entry with
putCollection
,
putEpub
, or
putPdf
, this is a high level API to try
syncing the change to the remarkable.
and entry, usually created by a put*
method
Optional
options: CreateMoveOptionssynced - if sync was successful
- -This API is provided to give a high level interface and to serve as an +
and entry, usually created by a put*
method
Optional
options: CreateMoveOptionsany extra options for creation
+synced - if sync was successful
+This API is provided to give a high level interface and to serve as an example of how to implement more advanced functionality, but it comes with a number of caveats:
This API is provided to give a high level interface and to se
However, with recent changes in the way this library caches results, it won't be terribly inefficient to just do multiple retries of create after uploading the file itself.
-const entry = await api.putEpub(...);
await api.create(entry);
-
error - if any error occurred, in this case, nothing will be changed
-get entries from a collection hash
+get metadata on all entries
-this uses a newer api, that returns metadata associated with all +
Optional
hash: stringget metadata on all entries
+this uses a newer api, that returns metadata associated with all entries and their hash and documentId.
-get a json object associated with a hash
This is identical to getText(hash).then(JSON.parse)
and is only provided
for consistency with putJson
.
get the root hash and the current generation
If this hasn't changed, then neither have any of the files.
-Optional
options: GetRootHashOptionshigh level api to move a document / collection
+Optional
options: GetRootHashOptionshigh level api to move a document / collection
Use this as a high level api to move files in the document tree.
-the document id of the document or collection to move
-the new parent of this collection or document; this should +
the document id of the document or collection to move
+the new parent of this collection or document; this should
be the document id of an existing collection, an empty string for root,
or the string "trash"
to move to the trash
Optional
opts: CreateMoveOptionssynced - true if synced successfully
- -This API is provided to give a high level interface and to serve as an +
Optional
opts: CreateMoveOptionsany extra options for moving
+synced - true if synced successfully
+This API is provided to give a high level interface and to serve as an example of how to implement more advanced functionality, but it comes with a number of caveats:
This API is provided to give a high level interface and to se
However, with changes to the way this caches results, it won't be terribly
inefficient to just retry calling move
if there's a failure.
const [root] = await api.getRootHash();
const entries = await api.getEntries(root);
const { documentId } = entries.find(...);
await api.move(documentId, "trash");
-
error - if any error occurred, in this case, nothing will be changed
-create a new collection (folder)
-Optional
parent: stringthe documentId of the parent collection (folder)
-put a reference to a set of entries into the cloud
-upload an epub
-the name to show for the uploaded epub
-the epub contents
-Optional
opts: PutEpubOptionsextra options you can specify at upload
-this only uploads the raw data and returns an entry that could be +
create a new collection (folder)
+the name of the new folder
+Optional
parent: stringthe documentId of the parent collection (folder)
+put a reference to a set of entries into the cloud
+upload an epub
+the name to show for the uploaded epub
+the epub contents
+Optional
opts: PutEpubOptionsextra options you can specify at upload
+this only uploads the raw data and returns an entry that could be uploaded as part of a larger collection. To make sure devices know about it, you'll still need to update the root hash, and potentially notify other devices.
-This example shows a full process upload. Note that it may fail if other devices are simultaneously syncing content. See putRootHash for more information.
const entry = await api.putEpub(...);
await api.create(entry);
-put json into the cloud
+put metadata into the cloud
This is a small wrapper around putText
.
this should be the documentId of the item that this is +
this should be the documentId of the item that this is
metadata for; it should not end in .metadata
the metadata to upload
-upload a pdf
-the name to show for the uploaded pdf
-the pdf contents
-Optional
opts: PutPdfOptionsextra options you can specify at upload
-this only uploads the raw data and returns an entry that could be +
the metadata to upload
+upload a pdf
+the name to show for the uploaded pdf
+the pdf contents
+Optional
opts: PutPdfOptionsextra options you can specify at upload
+this only uploads the raw data and returns an entry that could be uploaded as part of a larger collection. To make sure devices know about it, you'll still need to update the root hash, and potentially notify other devices.
-This example shows a full process upload. Note that it may fail if other devices are simultaneously syncing content. See putRootHash for more information.
const entry = await api.putPdf(...);
await api.create(entry);
-write the root hash, incrimenting from the current generation
This will fail if the current generation isn't equal to the passed in generation. Use this to preven race conditions. If this rejects, refetch the root hash, resync the updates, and then try to put again.
-the hash of the new root collection
-the current generation this builds off of
-the new generation
- -Updating the root hash can be dangerous as it changes the full +
the hash of the new root collection
+the current generation this builds off of
+the new generation
+Updating the root hash can be dangerous as it changes the full state of what's on the the remarkable. However, it's also the only way to change what's actually visible. If you're unsure if you're doing the right thing, make sure to first save your inital root hash. Then you can always recover by doing:
let [, gen] = await api.getRootHash();
await api.putRootHash(backup, gen);
-
GenerationError if the current cloud generation didn't match the expected pushed generation.
-put a raw text in the cloud encoded as utf-8
+indicate that a sync is complete and push updates to other devices
-after successfully putting a new root hash, use this to indicate +
upload an epub
-the name to show for the uploaded epub
-the epub contents
-this uses a newer api that performs a full upload and sync, but +
upload an epub
+the name to show for the uploaded epub
+the epub contents
+this uses a newer api that performs a full upload and sync, but doesn't allow adding the same level of extra content data. Useful if you just want to upload a document with no fuss.
-await api.uploadEpub("My EPub", ...);
-Experimental
-upload a pdf
+Experimental
upload a pdf
this currently uploads invalid pdfs, but it's not clear why, which is why this is marked as experimental. Potentially some tweak in the formatting of buffer will fix it.
-the name to show for the uploaded epub
-the epub contents
-this uses a newer api that performs a full upload and sync, but +
the name to show for the uploaded epub
+the epub contents
+this uses a newer api that performs a full upload and sync, but doesn't allow adding the same level of extra information.
-await api.uploadPdf("My PDF", ...);
-Generated using TypeDoc
Generated using TypeDoc
options for a remarkable instance
-Optional
auththe url for making authorization requests
-Optional
cachethe maximum size in bytes to cache the value of a stored object
+options for a remarkable instance
+Optional
auththe url for making authorization requests
+"https://webapp-prod.cloud.remarkable.engineering"
+
+Optional
cachethe maximum size in bytes to cache the value of a stored object
Since the remarkableApi is based around hashes, the value of a hash should never change (barring collisions in ASH256). Any known hash value that's less than this amount will be cached locally to prevent future network requests. In addition, all successful puts and gets will be cached to prevent duplicate puts in the future.
To save memory and disable fetch caching, set to 0.
-1 MiB
-Optional
fetchthe fetch method to use
+1 MiB
+
+Optional
fetchthe fetch method to use
This should loosely conform to the WHATWG fetch, but is relaxed enough that node-fetch also works. This will default to the global definitions of fetch.
In node you can either use "node-fetch"
, or node --experimental-fetch
for node 17.5 or higher.
globalThis.fetch
-Optional
inita set of values to use to initialize the cache
+globalThis.fetch
+
+Optional
inita set of values to use to initialize the cache
If this is inaccurate, then you could encounter errors with other methods.
Often this will come from getCache
.
Optional
subtlea subtle-crypto-like object
+Optional
subtlea subtle-crypto-like object
This should have a digest function like the api of crypto.subtle
, it's
default value. In node try
import { webcrypto } from "crypto"; global.crypto = webcrypto
or pass in
webcrypto.subtle
.
globalThis.crypto.subtle
-Optional
syncthe url for making synchronization requests
-Generated using TypeDoc
globalThis.crypto.subtle
+
+Optional
syncthe url for making synchronization requests
+"https://internal.cloud.remarkable.com"
+
+Generated using TypeDoc
stripped down version of RequestInit
-Optional
Readonly
bodyrequest body
-Optional
Readonly
headersrequest headers
-Optional
Readonly
methodrequest method
-Generated using TypeDoc
stripped down version of RequestInit
+Optional
Readonly
bodyrequest body
+Optional
Readonly
headersrequest headers
+Optional
Readonly
methodrequest method
+Generated using TypeDoc
stripped down version of Response
-headers in response
-true if request was successful
-http status
-text associated with status
-Generated using TypeDoc
stripped down version of Response
+headers in response
+true if request was successful
+http status
+text associated with status
+Generated using TypeDoc
stripped down version of subtle crypto
-Generated using TypeDoc
stripped down version of subtle crypto
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Create and interact with reMarkable cloud.
+Create and interact with reMarkable cloud.
After getting a device token with the register
method,
persist it and create api instances using remarkable
.
Outside of registration, all relevant methods are in
RemarkableApi
.
A simple fetch
+A simple fetch
import { register, remarkable } from "rmapi-js";
const code = "..." // eight letter code from https://my.remarkable.com/device/browser/connect
const token = await register(code)
// persist token
const api = await remarkable(token);
const rootEntries = await api.getEntries();
for (const entry of rootEntries) {
const children = await api.getEntries(entry.hash);
for (const { hash, documentId } of children) {
if (documentId.endsWith(".metadata")) {
const meta = api.getMetadata(hash);
// get metadata for entry
console.log(meta);
}
}
}
-
A simple upload
import { remarkable } from "rmapi-js";
const api = await remarkable(...);
const entry = await api.putEpub("document name", epubBuffer);
await api.create(entry);
-Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
extra content metadata
-Generated using TypeDoc
extra content metadata
+Generated using TypeDoc
remarkable file type; empty for notebook
-Generated using TypeDoc
remarkable file type; empty for notebook
+Generated using TypeDoc
metadata for a document or collection (folder)
+metadata for a document or collection (folder)
This is found in the the .metadata
file.
Generated using TypeDoc
Generated using TypeDoc
a full metadata entry returned by getEntriesMetadata
-Generated using TypeDoc
a full metadata entry returned by RemarkableApi.getEntriesMetadata
+Generated using TypeDoc
request types
-Generated using TypeDoc
request types
+Generated using TypeDoc
text alignment types
-Generated using TypeDoc
text alignment types
+Generated using TypeDoc
document matrix transform
-Generated using TypeDoc
document matrix transform
+Generated using TypeDoc
Const
font name options
-Generated using TypeDoc
Const
font name options
+Generated using TypeDoc
Const
line height options
-Readonly
df: -1default
-Readonly
lg: 150half
-Readonly
md: 100normal
-Readonly
xl: 200double
-Generated using TypeDoc
Const
line height options
+Readonly
df: -1default
+Readonly
lg: 150half
+Readonly
md: 100normal
+Readonly
xl: 200double
+Generated using TypeDoc
Const
margin options
-Readonly
lg: 200large
-Readonly
md: 125medium
-Readonly
rr: 180default for read on remarkable
-Readonly
sm: 50small
-Generated using TypeDoc
Const
margin options
+Readonly
lg: 200large
+Readonly
md: 125medium
+Readonly
rr: 180default for read on remarkable
+Readonly
sm: 50small
+Generated using TypeDoc
Const
text scale options
-Readonly
lg: 1.2large
-Readonly
md: 1medium / default
-Readonly
sm: 0.8small
-Readonly
xl: 1.5extra large
-Readonly
xs: 0.7the smallest
-Readonly
xx: 2double extra large
-Generated using TypeDoc
Const
text scale options
+Readonly
lg: 1.2large
+Readonly
md: 1medium / default
+Readonly
sm: 0.8small
+Readonly
xl: 1.5extra large
+Readonly
xs: 0.7the smallest
+Readonly
xx: 2double extra large
+Generated using TypeDoc
Const
tool options
-Generated using TypeDoc
Const
tool options
+Generated using TypeDoc
an error that results from trying yp update the wrong generation.
+- Preparing search index...
- The search index is not available
rmapi-jsClass GenerationError
an error that results from trying yp update the wrong generation.
If we try to update the root hash of files, but the generation has changed relative to the one we're updating from, this will fail.
-Hierarchy
--- Error
-
-- GenerationError
-
-Index
Constructors
-Properties
-Methods
-Constructors
-constructor
--- new
Generation Error(): GenerationError
--
-
Returns GenerationError
Properties
-
-Optional
causemessage
-name
-
-Optional
stack Stack Trace
-Static
Optional
prepareType declaration
---
-
-- (err, stackTraces): any
--
-
-
-
-
-
Optional override for formatting stack traces
-Parameters
---
-
--
-
err: Error
stackTraces: CallSite[]
Returns any
-See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
- Trace Limit
-Static
stackMethods
- Stack Trace
-Static
capture-- capture
Stack Trace(targetObject, constructorOpt?): void
--
-
-
-
-
Create .stack property on a target object
-Parameters
---
-
--
-
targetObject: object
Optional
constructorOpt: FunctionReturns void
--
-Settings
Member Visibility
Theme
-
-On This Page
-- constructor
-- cause
-- message
-- name
-- stack
-- prepare
Stack Trace
-- stack
Trace Limit
-- capture
Stack Trace
Generated using TypeDoc