JSS services and APIs
This topic describes the services and APIs available in the JavaScript Services SDK (JSS). These are, unless otherwise stated, available for all our supported JavaScript frameworks.
The services and APIs most frequently used by JSS applications follow a service-client-fetcher pattern of implementation. They support REST queries, GraphQL queries, or both, although we strongly recommend using GraphQL.
The services and APIs using this pattern are:
-
JSS Layout API - available for all frameworks, with REST and GraphQL endpoints.
-
JSS Dictionary API - available for all frameworks, with REST and GraphQL endpoints.
-
GraphQL Sitemap Service - available for Next.js only.
Depending on your local development setup, chosen development workflow, and framework, you might also need to understand the following:
Terminology
We use the following terminology for JSS services:
Factory
A factory creates an instance of a service. In the Next.js sample application, there are examples of factories for services with support for both GraphQL and REST.
Service
A service is a JavaScript abstraction (class) that facilitates retrieving Sitecore data. A service:
-
Accepts a configuration object.
-
Contains a fetch method.
-
Has a default client performing the fetching of data.
-
Defines data models.
-
Validates (developer input) logic.
-
Implements a default Fetcher.
Customize a service
The recommended method for customizing or extending a front-end JSS service is to:
-
Extend the service itself.
-
Use your new service in a service factory.