---
title: "Extending the Layout Service"
slug: "extending-the-layout-service"
abstract: "Overview of the options for customizing the data returned by the Layout Service"
---
# Extending the Layout Service

If you want to customize the output of the Layout Service, you have the following options:

- [Extending context data returned by the Layout Service](https://doc.sitecore.com/xp/en/developers/hd/23/sitecore-headless-development/extending-context-data-returned-by-the-layout-service.html "Extending context data returned by the Layout Service").
- [Customizing the Layout Service rendering output](https://doc.sitecore.com/xp/en/developers/hd/23/sitecore-headless-development/customizing-the-layout-service-rendering-output.html "Customizing the Layout Service rendering output").
- [Customize the serialization of a Sitecore field](https://doc.sitecore.com/xp/en/developers/hd/23/sitecore-headless-development/customize-the-serialization-of-a-sitecore-field.html "Customize the serialization of a Sitecore field").
- [Using a custom Layout Service configuration with JSS](https://doc.sitecore.com/xp/en/developers/hd/23/sitecore-headless-development/using-a-custom-layout-service-configuration-with-jss.html "Using a custom Layout Service configuration with JSS").

## Security considerations

The Layout Service output is not secure and can be inspected client-side. Treat it like an open API, ensuring you are not exposing sensitive or excess data.

When extending `Sitecore Context` object or building custom `Rendering Content Resolvers`:

- Only add fields necessary for front-end components. For example, do not inject the entire Sitecore Context object from back-end Sitecore pipelines into the Layout Service response.
- Add data that represents the global app state and must be accessed by multiple components.
- Avoid exposing sensitive information. Be aware of serialization depth to avoid accidentally exposing additional data through complex objects.