1.6.9 • Published 2 years ago

@storyofams/storyblok-toolkit v1.6.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Purpose

The aim of this library is to make integrating Storyblok in a React frontend easy.

We provide wrappers to abstract away the setup process (implementing the Storyblok JS Bridge, making the app work with the Visual Editor). We also provide an easy way to configure a GraphQL client, an optimized image component and some utility functions.

Installation

yarn add @storyofams/storyblok-toolkit
# or
npm install @storyofams/storyblok-toolkit

Features

The following API's are included:

  • withStory() and StoryProvider: withStory wraps a component/page where a story is loaded, and makes sure to keep it in sync with the Visual Editor. StoryProvider is a global provider that provides the context to make withStory work.
  • useStory(): alternative to withStory, gets the synced story.
  • getClient(): properly configures a graphql-request client to interact with Storyblok's GraphQL API.
  • Image: automatically optimized and responsive images using Storyblok's image service. With LQIP (Low-Quality Image Placeholders) support.
  • getImageProps(): get optimized image sizes without using Image.
  • getExcerpt(): get an excerpt text from a richtext field.
  • getPlainText(): get plaintext from a richtext field.

Next.js specific:

  • getStaticPropsWithSdk(): provides a properly configured graphql-request client, typed using graphql-code-generator to interact with Storyblok's GraphQL API, as a prop inside of getStaticProps.
  • nextPreviewHandlers(): API handlers to implement Next.js's preview mode.
1.6.9

2 years ago

1.6.8

3 years ago

1.6.7

3 years ago

1.6.6

3 years ago

1.6.5

3 years ago

1.7.0-beta.1

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.5.4

3 years ago

1.6.0

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.10

3 years ago

1.4.0-beta.6

3 years ago

1.4.0-beta.5

3 years ago

1.3.9

3 years ago

1.4.0-beta.4

3 years ago

1.3.8

3 years ago

1.4.0-beta.3

3 years ago

1.4.0-beta.2

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.4.0-beta.1

3 years ago

1.3.0-beta.1

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago