Skip to main content

API reference

Entry point​

NameDescription
LCPReadium LCP for react-native-readium: initialize it, answer passphrase requests, acquire books and manage their licenses. See LcpModule for every method.
LcpModuleThe API of LCP, the package's entry point: Readium LCP for react-native-readium.

Classes​

ClassDescription
LcpErrormessage is plain English, fit to show a user. To word or translate it yourself, switch on code and use the details, e.g. date for the license-status codes.

Functions​

FunctionDescription
describeLcpErrorThe plain-English message an LcpError with this code carries, for a code you already have, such as a license's restriction.

Interfaces​

InterfaceDescription
LcpErrorDetailsWhat native code reports with an error, besides its code.
LcpInitOptionsOptions for LCP.initialize.
LcpLinkA link from a license, e.g. to its passphrase hint or its provider's support page.
LcpAuthRequestSent to the JS authentication handler when a license needs its passphrase.
LcpAcquiredPublicationA publication downloaded by LCP.acquirePublication.
LcpLicenseA publication's license, as LCP.getLicense and LCP.renewLoan report it.
AcquirePublicationOptionsOptions for LCP.acquirePublication.
GetLicenseOptionsOptions for LCP.getLicense.
RenewLoanOptionsOptions for LCP.renewLoan.
AddPassphraseOptionsOptions for LCP.addPassphrase.
LcpCapabilitiesWhat this platform's Readium LCP module can do; not every API exists on both.
LcplSourceWhere to find a license document (.lcpl). Set exactly one field.

Type Aliases​

Type AliasDescription
LcpErrorCodeWhy an LCP call failed: the code of an LcpError. Native code reports these by name, so the generated native enums keep both platforms to the same set.
LcpAuthReasonWhy a passphrase is requested: none is stored for the license (passphraseNotFound), or the last one given was wrong (invalidPassphrase).
LcpLicenseStatusA license's status, as its license server reports it.
LcpAuthHandlerAnswers a passphrase request; see LCP.setAuthenticationHandler. Resolve with the passphrase, in clear text or as its SHA-256 hex hash, or undefined to give up.