{"id":29687255,"url":"https://github.com/thepalaceproject/web-opds-client","last_synced_at":"2026-01-20T16:42:27.642Z","repository":{"id":38981776,"uuid":"486832068","full_name":"ThePalaceProject/web-opds-client","owner":"ThePalaceProject","description":"OPDS web client","archived":false,"fork":false,"pushed_at":"2025-07-21T23:20:59.000Z","size":4892,"stargazers_count":0,"open_issues_count":7,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-22T15:03:42.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThePalaceProject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2022-04-29T04:03:16.000Z","updated_at":"2025-06-10T13:22:55.000Z","dependencies_parsed_at":"2025-04-17T00:04:21.031Z","dependency_job_id":"0cacb41f-8850-4ae2-b68f-c7d80d64553a","html_url":"https://github.com/ThePalaceProject/web-opds-client","commit_stats":{"total_commits":901,"total_committers":13,"mean_commits":69.3076923076923,"dds":0.7358490566037736,"last_synced_commit":"0b8078f2f98a5d61de5283384a7c39864bbdeffc"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ThePalaceProject/web-opds-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fweb-opds-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fweb-opds-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fweb-opds-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fweb-opds-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThePalaceProject","download_url":"https://codeload.github.com/ThePalaceProject/web-opds-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePalaceProject%2Fweb-opds-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266619009,"owners_count":23957273,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-07-23T04:36:28.017Z","updated_at":"2026-01-20T16:42:27.617Z","avatar_url":"https://github.com/ThePalaceProject.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# web-opds-client\n\nJavaScript OPDS web client\n\n## Standalone App\n\nOPDS Web Client can be run as a standalone app mounted in a DOM element:\n\n```javascript\nnew OPDSWebClient(config, elementId);\n```\n\nFor an example of OPDS Web Client in use as a standalone app, see the [demo server template](https://github.com/ThePalaceProject/web-opds-client/blob/master/packages/server/views/index.html.ejs) included in this repository.\n\n_NOTE_: The web reader has been taken out of the demo server template for now as it is causing build issues. If you want to install it locally and use it for testing, uncomment line 17 in `/packages/server/index.js`, and install it in the `/packages/server` directory:\n\n```bash\n $ npm install --save nypl-simplified-webpub-viewer\n```\n\n### Standalone Config Options\n\n- `pathFor(collectionUrl: string, bookUrl: string) =\u003e string`: required function that accepts a collection URL and book URL and returns a string that will become the web browser's relative URL upon navigating to a new collection or book\n- `pathPattern`: a react-router [path pattern](https://reacttraining.com/react-router/core/api/Route/path-string-string) representing how to map a web browser URL to a collectionUrl and bookUrl. Default: `/(collection/:collectionUrl/)(book/:bookUrl/)`\n- `collectionUrl`: optional initial URL of an OPDS feed to load. Default: `null` (allow user to enter URL)\n- `bookUrl`: optional initial URL of an OPDS Entry to load. Default: `null`\n- `proxyUrl`: optional local proxy path to which all remote URLs will be posted. Default: `undefined`\n- `pageTitleTemplate(collectionTitle: string, bookTitle: string) =\u003e string`: optional function that accepts a collection and book title and returns an HTML page title. Default: `undefined`\n- `authPlugins`: optional list of objects that implement the [`AuthPlugin` interface](http://ThePalaceProject.github.io/web-opds-client/interfaces/authplugin.html). Default: [`BasicAuthPlugin`](http://ThePalaceProject.github.io/web-opds-client/globals.html#basicauthplugin)\n- `computeBreadcrumbs`: optional function for customizing breadcrumbs. It defaults to `defaultComputeBreadcrumbs` in the [Breadcrumbs](https://github.com/ThePalaceProject/web-opds-client/blob/master/packages/web-opds-client/src/components/Breadcrumbs.tsx) module, and `hierarchyComputeBreacrumbs` is also available. It should return an array of link objects, each with `url` and `text` properties. Its accepts two arguments:\n  - `collection`: object representing the current collection data (see `CollectionData` in the [interfaces file](https://github.com/ThePalaceProject/web-opds-client/blob/master/packages/web-opds-client/src/interfaces.ts))\n  - `history`: an array of link objects (each with `url` and `text` properties) that is appended every time the user navigates to a new collection\n- `epubReaderUrlTemplate(epubUrl: string) =\u003e string`: optional function that returns a URL where you can read an EPUB file.\n- `allLanguageSearch`: optional string to specify if searches in the catalog should not use the browser's language header in requests. Default: `false`\n- `fetcher`: optional custom instance of `DataFetcher` to use for network requests. If not provided, a new instance will be created. Default: `undefined`\n\n## React Component\n\nThe application is also available as a reusable React component:\n\n```jsx\nimport OPDSCatalog from \"web-opds-client\";\n\nReactDOM.render(\n  \u003cOPDSCatalog\n    collectionUrl={this.props.collectionUrl}\n    bookUrl={this.props.bookUrl}\n    pageTitleTemplate={this.pageTitleTemplate}\n    BookDetailsContainer={BookDetailsContainer}\n    Header={Header}\n  /\u003e\n);\n```\n\nFor an example of the application in use as a React component, see [ThePalaceProject/circulation-admin](https://github.com/ThePalaceProject/circulation-admin).\n\n### React Component Props\n\n- `collectionUrl`: optional URL of an OPDS Acquisition or Navigation feed to load. Default: `null`\n- `bookUrl`: optional URL of an OPDS Entry to load. Default: `null`\n- `pageTitleTemplate(collectionTitle: string, bookTitle: string) =\u003e string`: optional function that accepts a collection and book title and returns an HTML page title. Default: `undefined`\n- `Header`: optional custom React component class to render in place of the client's default header. This `Header` will receive three props, `collectionTitle`, `bookTitle`, and a `CatalogLink` which should be used for links to collections or books that the client should load, and one child, a `Search` component that will only be present when the loaded collection links to an Open Search Description document. Default: `undefined`\n- `BookDetailsContainer`: optional custom React component class to render in place of the client's default `BookDetails` component. This `BookDetailsContainer` will receive three props: the current `collectionUrl` and `bookUrl`, and `refreshCatalog`, a function that can be called to refresh the collection and/or book. `BookDetailsContainer` will also receive the default rendered `BookDetails` component as a child. Default: `undefined`\n- `authPlugins`: same as in \"Standalone Config Options\" above\n- `computeBreadcrumbs`: same as in \"Standalone Config Options\" above\n- `epubReaderUrlTemplate`: same as in \"Standalone Config Options\" above\n- `fetcher`: same as in \"Standalone Config Options\" above\n\n### React Component Context\n\nThe OPDSCatalog React component should be rendered within a [React context](https://facebook.github.io/react/docs/context.html) that includes two items:\n\n- `router`: any object that implements the `push` and `createHref` methods of react-router's [context.router](https://reacttraining.com/react-router/core/api/contextrouter)\n- `pathFor(collectionUrl: string, bookUrl: string) =\u003e string`: a function that accepts a collection URL and book URL and returns a string that will become the web browser's relative URL upon navigating to a new collection or book\n\n## Accessibility\n\nIn order to develop user interfaces that are accessible to everyone, there are tools added to the workflow. Besides the Typescript `tslint-react-a11y` plugin (in `/packages/web-opds-client/tslint.json`), `react-axe` is also installed for local development. Using that module while running the app uses a lot of resources so it should be only when specifically testing for accessibility and not while actively developing new features or fixing bugs.\n\nIn order to run the app with `react-axe`, run `npm run dev-test-axe`. This will add a local global variable `process.env.TEST_AXE` (through webpack) that will trigger `react-axe` in `/packages/web-opds-client/src/app.tsx`. The output will be seen in the _browser's_ console terminal.\n\n## License\n\n```\nCopyright © 2015 The New York Public Library, Astor, Lenox, and Tilden Foundations\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepalaceproject%2Fweb-opds-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthepalaceproject%2Fweb-opds-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepalaceproject%2Fweb-opds-client/lists"}