
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@data-provider/prismic
Advanced tools
This package provides a Data Provider origin for reading data from Prismic CMS API. As underlay, it uses the prismic-javascript client to provide the Prismic data.
import { Prismic } from "@data-provider/prismic"
new Prismic(options)
<Object> Apart from common Data Provider options, this addon has next custom options:<String>. Prismic api url.
<Boolean> If true, the full response of the Prismic api will be used as value. If false, only the response.results property will be returned, which is the default behavior.<String> Prismic release to be read. This parameter will be passed as ref to the prismic-javascript query.prismic.query(queryValue)
<Object> containing properties:
<String> Prismic document type to filter by. (It will be used to build a prismic-javascript query as in PrismicJs.Predicates.at("document.type", documentType))Configure instance for all next read executions.
prismic.config(options)
<Object> containing properties:
<String> Prismic api url.<Boolean> If true, the full response of the Prismic api will be used as value. If false, only the response.results property will be returned, which is the default behavior.<String> Prismic release to be read. This parameter will be passed as ref to the prismic-javascript query.Read about how to configure all @data-provider/prismic instances at a time using the Data Provider providers handler.
Example of how to change all @data-provider/prismic requests urls at a time:
import { providers } from "@data-provider/core";
providers.getByTag("prismic").config({
url: "https://foo-prismic-repository.cdn.prismic.io/api/v2"
});
// All @data-provider/prismic instances will now be configured to request to provided url.
Next example will be easier to understand if you are already familiarized with the Data Provider syntax.
import { Prismic } from "@data-provider/prismic";
const prismic = new Prismic({
url: "https://foo-prismic-repository.cdn.prismic.io/api/v2",
release: "foo-release"
});
prismic
.query({ documentType: "home-banner" })
.read()
.then(results => {
console.log("Prismic content for home banner in foo-release", results);
});
Please refer to the @data-provider/react UI addon documentation to see how simple is the data-binding between React Components and @data-provider/prismic.
Connect a provider to all components that need it. Data Provider will fetch data only when needed, and will avoid making it more than once, no matter how many components need the data.
Providers created with this addon will have automatically the prismic tag, so you can select all of them together using the providers methods as in:
import { providers } from "@data-provider/core";
providers.getByTag("prismic").cleanCache();
Contributors are welcome. Please read the contributing guidelines and code of conduct.
FAQs
Data Provider for reading data from Prismic CMS API
The npm package @data-provider/prismic receives a total of 6 weekly downloads. As such, @data-provider/prismic popularity was classified as not popular.
We found that @data-provider/prismic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.