JS Api: Get all available locales

Hi there,

with the JS API I want to fetch all available locales. I understood that fetching the api at cdn level returns the languages but how would I achieve this using a JS Prismic client? Is there a prismic predicate for it?

The post I'm referring to is this one:

Thx

Hi Andreas,

You just need to query the api to get that info using the method described here:

So to get the languages it would be something like:

Prismic.api("https://your-repository-name.cdn.prismic.io/api/v2").then(function(api) {
  languages = api.data.languages
});

Let me know if this helps.

This issue has been closed due to inactivity.