@prismicio/client
v7
We’re excited to announce a new major version of @prismicio/client
, the core Prismic package for creating web apps with Prismic and JavaScript.
@prismicio/client
v7 combines @prismicio/client
, @prismicio/helpers
, and @prismicio/types
into one package, offering a leaner API with a smaller footprint on your project.
import { createClient, asText, RichTextField } from "@prismicio/client"
// Create a Prismic client
const client = createClient("example-repo-name")
// Query for documents
const page = await client.getByUID("page", "home")
// Convert rich text fields to plain text
const title = asText(page.data.title)
// ^ Typed as RichTextField
As a result of the streamlining, @prismicio/helpers
and @prismicio/types
are now considered deprecated.
Benefits of upgrading
- One single package now covers core Prismic usage (compared to 3 required before)
- Deprecated APIs from
@prismcio/client
v5 and v6 were removed - Deprecated APIs from
@prismicio/helpers
v2 were removed - Deprecated APIs from
@prismicio/types
v0 were removed - Improved code-splitting and tree shaking
How to upgrade
Upgrading is straightforward, but requires a few changes to your project.
See the @prismicio/client
v7 Migration Guide for instructions.
Any questions?
Please leave any questions about @prismicio/client
v7 here and we’ll answer as soon as possible.
If you encounter a bug or would like to request a new feature, open an issue on GitHub.