@prezly/theme-kit-core
TypeScript icon, indicating that this package has built-in type declarations

9.3.2 • Public • Published

JavaScript Prezly Theme Kit

Version License

This library is a collection of data-fetching and utility functions to abstract some of the under-the-hood logic used by Prezly sites and help developers create themes with JavaScript much faster.

The package is built with Typescript on top of Prezly SDK.

Adding the library to your theme

npm

npm install --save @prezly/sdk @prezly/theme-kit-core

peerDependencies

This library depends on @prezly/sdk, which provides the communication with Prezly API and typings. We will occasionally bump the minimum required SDK version to ensure compatibility with latest Prezly features.

.env

Prezly themes use two ways of getting base environment variables:

  • Getting variables straight from .env file
  • Extracting variables from HTTP headers (when hosted on the Prezly infrastructure)

For local development, and for self-hosted themes, you can only use the former option. Add these variables to your .env file:

PREZLY_ACCESS_TOKEN=your access token
PREZLY_NEWSROOM_UUID=your site UUID
PREZLY_THEME_UUID=your theme UUID

PREZLY_THEME_UUID variable is only reqiured for developing themes that are already hosted on Prezly infrastructure. It determines which theme preset will be pulled from the API. For self-hosted themes, you'll want to handle the theme settings in some other way.

If you don't have these credentials, you can use one of our testing sites credentials.


What's next

This kit is just a collection of building blocks, so it doesn't really force any page structure or guidelines on how to render the content. You can learn more on how this kit can be used by checking the code of Prezly's themes:

  • Prezly Starter Theme - this is a bare-bones application created to demonstrate how to display the fetched content and recommended page structure
  • Prezly Bea Theme - this is our new fully-fledged theme available to all Prezly customers. It has lots of stuff on top, both in styling and in data logic.

You can also learn more about Prezly API by checking out typings in Prezly SDK package, and referring to the Prezly API Docs


Brought to you by Prezly.

Readme

Keywords

Package Sidebar

Install

npm i @prezly/theme-kit-core

Weekly Downloads

282

Version

9.3.2

License

MIT

Unpacked Size

195 kB

Total Files

137

Last publish

Collaborators

  • mohammadxali
  • francis-prezly
  • pestaa
  • kudlik
  • digitalbase
  • e1npm
  • satoav
  • makanda