Getting started

Installation

npm install @prose-reader/core @prose-reader/streamer rxjs

You don't absolutely need to have @prose-reader/core-streamer installed to run the reader but the utilities provided are very useful to standardize and feed books to the engine. rxjs is a peer-dependency of prose-reader and needs to be installed alongside.

Create your reader & load your book

On your html file you need to define a container for the reader. We will be using a full screen reader but you can have any dimensions.

index.html

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <style>
      body,
      html,
      #app {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
      }
    </style>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="./index.tsx"></script>
  </body>
</html>

The next step is to create a streamer and load our book into the reader. There is a lot of comment on purpose to help you understand the basic flow but in the end the code is rather simple.

There is a lot of comments in the code to explain the basic but the bootstrap and use of the SDK is fairly simple.

We are gonna use an epub as example so you should also install jszip

index.ts

You should now see the book being displayed.

Explore the next sections to see how to add functionalities such as navigating, gestures, etc.

Last updated

Was this helpful?