[System] You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.

[User] Provide a guide on guides developing a graphql api in service apps in VTEX.

[Assistant]
Documentation

[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)

[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/api-reference)

[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/storefront-development)

[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/troubleshooting)

[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/updates/release-notes)

App Development

[What is VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-what-is-vtex-io)

---

[What is a VTEX App](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-what-is-a-vtex-app)

---

[Governance and shared security in VTEX IO apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/governance-and-shared-security-in-vtex-io-apps)

---

[Code samples and templates](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/code-samples)

---

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-getting-started)

---

Project structure

---

[VTEX IO CLI](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-vtex-io-cli-installation-and-command-reference)

---

[Workspace](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-workspace)

---

Managing apps

---

Development guides

---

[Node apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/app-development-guides)

---

[GraphQL in VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/graphql-in-vtex-io)

[List of GraphQL APIs](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-graphql-api-list)

[Developing a GraphQL API in service apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps)

[GraphQL authorization in IO apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/graphql-authorization-in-io-apps)

[Integrating an app with a GraphQL API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/integrating-an-app-with-a-graphql-api)

[Implementing cache in GraphQL APIs for IO apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/implementing-cache-in-graphql-apis-for-io-apps)

[Admin GraphQL IDE](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/graphql-ide)

---

[Policies and permissions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-policies)

---

[A/B tests](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/ab-tests)

---

[Deployment](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-making-your-new-app-version-publicly-available)

---

[VTEX App Store](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-app-store)

---

[Edition Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/managing-edition-apps)

---

[Frequently asked questions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-frequently-asked-questions)

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/storefront-development)

[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/vtex-io-apps)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/updates/release-notes)

App Development

[What is VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-what-is-vtex-io)

---

[What is a VTEX App](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-what-is-a-vtex-app)

---

[Governance and shared security in VTEX IO apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/governance-and-shared-security-in-vtex-io-apps)

---

[Code samples and templates](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/code-samples)

---

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-getting-started)

---

Project structure

---

[VTEX IO CLI](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-vtex-io-cli-installation-and-command-reference)

---

[Workspace](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-workspace)

---

Managing apps

---

Development guides

---

[Node apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/app-development-guides)

---

[GraphQL in VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/graphql-in-vtex-io)

[List of GraphQL APIs](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-graphql-api-list)

[Developing a GraphQL API in service apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps)

[GraphQL authorization in IO apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/graphql-authorization-in-io-apps)

[Integrating an app with a GraphQL API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/integrating-an-app-with-a-graphql-api)

[Implementing cache in GraphQL APIs for IO apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/implementing-cache-in-graphql-apis-for-io-apps)

[Admin GraphQL IDE](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/graphql-ide)

---

[Policies and permissions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-policies)

---

[A/B tests](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/ab-tests)

---

[Deployment](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-making-your-new-app-version-publicly-available)

---

[VTEX App Store](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-app-store)

---

[Edition Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/managing-edition-apps)

---

[Frequently asked questions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/vtex-io-documentation-frequently-asked-questions)

---

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/app-development)

[GraphQL in VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/graphql-in-vtex-io)

[Developing a GraphQL API in service apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps)

Developing a GraphQL API in service apps

Learn how to create a GraphQL API with Node-based VTEX IO service apps.

When developing a [service app](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-service), you may need to expose an API so that other systems, such as other VTEX IO apps or external integrations, can interact with it. There are two options for developing APIs: [REST](https://read.calvincode.net/reader?url=https://restfulapi.net/) and [GraphQL](https://read.calvincode.net/reader?url=https://graphql.org/). REST is commonly used for interacting with other services and external integrations, while GraphQL is usually recommended for interactions with frontend apps and systems.

This guide will show you how to create an API using GraphQL and VTEX IO.

> For details about REST API development, see [Developing services in VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-services-on-vtex-io).

## Before you begin

Make sure to check the technical requirements to follow this guide:

* [VTEX IO CLI is installed](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-vtex-io-cli-install) on your computer.
* Access to a VTEX store with a [development workspace](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-creating-a-development-workspace) and the Admin environment.
* Knowledge of GraphQL and related concepts, such as [queries](https://read.calvincode.net/reader?url=https://graphql.org/learn/queries/), [schema](https://read.calvincode.net/reader?url=https://graphql.org/learn/schema/), and [resolvers](https://read.calvincode.net/reader?url=https://graphql.org/learn/execution/).
* Experience developing in the [TypeScript](https://read.calvincode.net/reader?url=https://www.typescriptlang.org/) language.

## App behavior

The basic behavior of a service app with a GraphQL API works as follows:

1. A requester (store user, another app, external service, etc.) makes a GraphQL request to an app instantiated in a VTEX store.
2. Upon receiving the request, the app executes it through a resolver function.
3. The resolver uses a [VTEX client](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-clients) to call the desired resource ([VTEX API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/getting-started-list-of-rest-apis), another app, external service, etc.).
4. The app receives the response from the resource and continues executing the resolver.
5. The resolver generates the response body of the request based on the received data.
6. The app returns the GraphQL request to the requester with the response body.

RequesterAppResourceGraphQL requestClient requestResponseResponseRequesterAppResource

## Implementation

The next sections explain how to implement a GraphQL API in a service app. This example shows how to display mocked data about live users accessing product pages. The implementation includes creating the GraphQL schema, a [custom client](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-how-to-create-and-use-clients), and a resolver function.

### 1\. Start with a template

We recommend downloading a VTEX IO app template to your computer if you are developing an app from scratch. There are two main options for app templates in this case:

* [graphql-example](https://read.calvincode.net/reader?url=https://github.com/vtex-apps/graphql-example): Service template with basic implementation of GraphQL and Node.
* [service-example](https://read.calvincode.net/reader?url=https://github.com/vtex-apps/service-example): Service template with basic implementation of Node, without GraphQL.

The next steps of this guide will use the service-example template to demonstrate how to implement a GraphQL API from scratch.

You can clone the repository using the following command in a terminal:

`1

git clone https://github.com/vtex-apps/service-example

`

### 2\. Add the GraphQL builder

Open the `manifest.json` file in your app's root and add the [GraphQL builder](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-graphql-builder). The builder interprets the GraphQL schema defined in your TypeScript code in the `node` folder.

> Your app may already have the GraphQL builder configured. If that's the case, you only need to check if it uses the latest builder version (1.x).

`1

"builders": {

2

 "node": "7.x",

3

 "graphql": "1.x"

4

}

`

### 3\. Define the GraphQL schema

In the `graphql` folder, add the `.graphql` files to define the GraphQL schema. You can add the entire schema in a single file or use multiple files, including subfolders. To better organize your project, we recommend using the following structure:

* Add your endpoints (queries, mutations, or subscriptions) in the `schema.graphql` file.
* Add the directives in the `directives.graphql` file.
* Create a `types` subfolder and add one `.graphql` file for each type to be defined in the schema.

`1

graphql

2

┣ 📂 types

3

 ┣ 📄 a_type.graphql

4

 ┗ 📄 b_type.graphql

5

┣ 📄 directives.graphql

6

┗ 📄 schema.graphql

`

#### Type example

graphql/types/ProductView.graphql

`1

type ProductView {

2

 slug: String

3

 liveUsers: Int

4

}

`

#### Query schema example

graphql/schema.graphql

`1

type Query {

2

 getSku(topN: Int): String

3

}

`

> GraphQL has many more functionalities you can add to the schema, such as mutations, subscriptions, and directives. See the [official GraphQL documentation](https://read.calvincode.net/reader?url=https://graphql.org/learn/) for details.

### 4\. Declare the list of clients

Your app will likely access an external resource such as [VTEX APIs](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/getting-started-list-of-rest-apis), an endpoint from another app, or a service external to VTEX. Within VTEX services, these interactions are handled through [clients](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-clients).

Instead of calling endpoints directly in your resolver functions, you should define and use clients to encapsulate your HTTP logic and keep your resolvers clean and focused.

#### Using VTEX native clients

VTEX provides built-in clients for commonly used services, such as Catalog, OMS, and Checkout.

Here's an example of how to add the Catalog client to your app:

1. Open the terminal.
2. Install the `@vtex/clients` package in the `node` folder of your app:
`1
cd node
2
yarn add @vtex/clients
`
3. Open `node/clients/index.ts` and extend the `IOClients` class to register the `catalog` client:
node/clients/index.ts
`1
import { IOClients } from '@vtex/api'
2
import { Catalog } from '@vtex/clients'
3

4
// Extend the default IOClients implementation with our own custom clients.
5
export class Clients extends IOClients {
6
 public get catalog() {
7
 return this.getOrSet('catalog', Catalog)
8
 }
9
}
`

This setup allows you to access the `catalog` client in your resolvers through the app's context.

#### Using external resources

To access routes and resources not available through the native clients, you need to [develop your custom client](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-how-to-create-and-use-clients). Similar to native clients, you must register each custom client in the `Clients` class located in `node/clients/index.ts` so it can be accessed across your app.

### 5\. Define the resolvers

Resolvers are the functions that are executed when a GraphQL endpoint is called. A resolver function must have the same name as its corresponding endpoint. Follow the steps below to define your resolvers:

1. In the `node` folder, create another folder called `resolvers`.
2. In the new folder, add the TypeScript files that will contain resolver code. We recommend creating a `.ts` file for each resolver.
3. In the created files, add the resolver code. The following example shows a resolver that you can use as a reference:

node/resolvers/products.ts

`1

export const getSku = async (

2

 _: any,

3

 { code }: { code: number },

4

 { clients: { catalog } }: Context

5

) =>

6

 catalog

7

 .getSkuById(code.toString())

8

 .then((data) => data.Name)

`

### 6\. Instantiate the resolvers

After defining your resolver functions, add them to the `Service` class of the `node/index.ts` file. You should add a `graphql` field that contains the resolvers for each implemented endpoint.

node/index.ts

`1

import type { ClientsConfig, ServiceContext, RecorderState } from '@vtex/api'

2

import { LRUCache, method, Service } from '@vtex/api'

3

import { productList } from './resolvers/products'

4

5

...

6

7

export default new Service({

8

 clients,

9

 graphql:{

10

 resolvers: {

11

 Query: {

12

 getSku,

13

 },

14

 },

15

 },

16

})

`

### 7\. Add the policies

If your app accesses external endpoints and resources, add the required policies to your `manifest.json`:

manifest.json

`1

"policies": [

2

 {

3

 "name": "outbound-access",

4

 "attrs": {

5

 "host": "portal.vtexcommercestable.com.br",

6

 "path": "/api/catalog/*"

7

 }

8

 }

9

],

`

### 8\. Link your app

To test your app, [link](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-linking-an-app) it to the VTEX platform so it can run and accept requests.

Open a terminal and switch to a [development workspace](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-creating-a-development-workspace). Then, use the `vtex link` command.

`1

vtex link

`

### 9\. Test your endpoints

With your app running, you can test the implemented endpoints by making requests. One way to do this is using the VTEX [GraphQL IDE](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/graphql-ide) in the Admin panel:

1. Install the GraphQL IDE app by running `vtex install vtex.admin-graphql-ide` in your terminal.
2. Open the VTEX Admin in the workspace to which your app was linked. In your browser, go to `https://{workspace}--{account}.myvtex.com/admin`.
3. Go to **Store Settings** \> **Storefront** and click **GraphQL IDE**.
4. Select the linked VTEX IO app.
5. Write the query to test your endpoint. Here is an example:
`1
{
2
 getSku(code: 1)
3
}
`
6. Run the query by clicking the `Play` ▶ button in the top-left corner. You should see the result of your query on the right side of the window. Here is an example:
`1
{
2
 "data": {
3
 "getSku": "50 ml"
4
 }
5
}
`

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F7026595%3Fv%3D4%26w=64%26q=75)](https://github.com/henriquessb)

Was this helpful?

Yes

No

[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/vtex-io/GraphQL/developing-a-graphql-api-in-service-apps.mdx)

[List of GraphQL APIs« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps//docs/guides/vtex-io-graphql-api-list)[GraphQL authorization in IO appsNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps//docs/guides/graphql-authorization-in-io-apps)

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F7026595%3Fv%3D4%26w=64%26q=75)](https://github.com/henriquessb)

ON THIS PAGE

[Before you begin](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%23before-you-begin)

[App behavior](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%23app-behavior)

[Implementation](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%23implementation)

[1\. Start with a template](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%231-start-with-a-template)[2\. Add the GraphQL builder](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%232-add-the-graphql-builder)[3\. Define the GraphQL schema](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%233-define-the-graphql-schema)[4\. Declare the list of clients](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%234-declare-the-list-of-clients)[5\. Define the resolvers](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%235-define-the-resolvers)[6\. Instantiate the resolvers](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%236-instantiate-the-resolvers)[7\. Add the policies](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%237-add-the-policies)[8\. Link your app](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%238-link-your-app)[9\. Test your endpoints](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%239-test-your-endpoints)

Was this helpful?

 Send feedback

[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/vtex-io/GraphQL/developing-a-graphql-api-in-service-apps.mdx)

Copy page

On this page

ON THIS PAGE

[Before you begin](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%23before-you-begin)

[App behavior](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%23app-behavior)

[Implementation](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%23implementation)

[1\. Start with a template](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%231-start-with-a-template)[2\. Add the GraphQL builder](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%232-add-the-graphql-builder)[3\. Define the GraphQL schema](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%233-define-the-graphql-schema)[4\. Declare the list of clients](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%234-declare-the-list-of-clients)[5\. Define the resolvers](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%235-define-the-resolvers)[6\. Instantiate the resolvers](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%236-instantiate-the-resolvers)[7\. Add the policies](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%237-add-the-policies)[8\. Link your app](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%238-link-your-app)[9\. Test your endpoints](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/developing-a-graphql-api-in-service-apps/docs/guides/developing-a-graphql-api-in-service-apps%239-test-your-endpoints)

On this page

[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)


[System] You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.

[User] Provide a guide on guides vtex io documentation using the markers prop to customize a blocks message in VTEX.

[Assistant]
Documentation

[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)

[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/api-reference)

[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/storefront-development)

[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/troubleshooting)

[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/updates/release-notes)

Storefront Development

[Getting started with storefront solutions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/faststore)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework)

[Store Theme](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-store-theme)

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/getting-started-3)

Concepts

[Building pages](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-building-pages)

[Using components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-using-components)

[Using advanced layouts](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-using-advanced-layouts)

[Working with Site Editor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-working-with-site-editor)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-styling)

[Using CSS Handles for store customization](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-using-css-handles-for-store-customization)

[Contributing with new CSS Handles](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-contributing-with-new-css-handles)

[Customizing your store's icons](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-customizing-your-stores-icons)

[Customizing your store’s typography](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-customizing-your-stores-typography)

[Interactively inspecting storefront blocks](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/how-to-interactively-inspect-blocks-on-a-store-framework-store)

[Using the Markers prop to customize a block's message](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message)

[Dealing with events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-dealing-with-events)

[Configuring Analytics (Google Tag Manager)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-configuring-analytics-google-tag-manager)

[Setting up cross-border stores](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-setting-up-cross-border-stores)

[Handling internationalization](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-multi-language-stores)

[Routing](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-routing)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-managing-performance)

[Improving store accessibility with semantic HTML migration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-semantic-html-migration)

[Going live](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-go-live)

[Updating live stores](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-updating-live-stores)

---

(Legacy) CMS Portal

---

[Storefront best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/storefront-best-practices)

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/storefront-development)

[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/vtex-io-apps)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/updates/release-notes)

Storefront Development

[Getting started with storefront solutions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/faststore)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework)

[Store Theme](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-store-theme)

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/getting-started-3)

Concepts

[Building pages](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-building-pages)

[Using components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-using-components)

[Using advanced layouts](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-using-advanced-layouts)

[Working with Site Editor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-working-with-site-editor)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-styling)

[Using CSS Handles for store customization](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-using-css-handles-for-store-customization)

[Contributing with new CSS Handles](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-contributing-with-new-css-handles)

[Customizing your store's icons](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-customizing-your-stores-icons)

[Customizing your store’s typography](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-customizing-your-stores-typography)

[Interactively inspecting storefront blocks](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/how-to-interactively-inspect-blocks-on-a-store-framework-store)

[Using the Markers prop to customize a block's message](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message)

[Dealing with events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-dealing-with-events)

[Configuring Analytics (Google Tag Manager)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-configuring-analytics-google-tag-manager)

[Setting up cross-border stores](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-setting-up-cross-border-stores)

[Handling internationalization](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-multi-language-stores)

[Routing](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-routing)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-managing-performance)

[Improving store accessibility with semantic HTML migration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-semantic-html-migration)

[Going live](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-go-live)

[Updating live stores](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-updating-live-stores)

---

(Legacy) CMS Portal

---

[Storefront best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/storefront-best-practices)

---

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/storefront-development)

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/store-framework-styling)

[Using the Markers prop to customize a block's message](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message)

Using the Markers prop to customize a block's message

When styling storefront components, CSS Handles and Block Classes are helpful for general styles. However, to customize specific text messages within blocks, you can use the `markers` prop. This prop lets you add unique identifiers to parts of a block’s message, making it easier to apply targeted styles.

Follow the steps below to use the `markers` prop for customizing block messages.

## Before you begin

Check if the block you want to customize supports the `markers` prop. This information can usually be found in the block’s documentation.

## Instructions

1. Open the terminal and use the [VTEX IO CLI](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-vtex-io-cli-installation-and-command-reference/) to log in to your VTEX account.
2. Change to a [development workspace](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-creating-a-development-workspace/).
3. Open your Store Theme using your preferred code editor and locate the block where you want to use the `markers` prop.
4. In the block's configuration, add the `markers` prop with a unique value (e.g., `discount`). For example:
`1
"product-price-savings#summary": {
2
 "props": {
3
 "markers": [
4
 "discount"
5
 ],
6
 }
7
},
`
5. Save your changes and [link](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-linking-an-app/) the app to your workspace.
6. Open the Admin of your workspace at (`{workspaceName}--{accountName}.myvtex.com/admin`).
7. Go to the Site Editor and select the block to which you addeed the `markers` prop.
8. In the Site Editor, wrap the message variable you want to customize with the `markers` value. For example, to style the discount percentage in a product price block, you can wrap it with the markers tag like this: `<discount>-{savingsPercentage}</discount>`. This allows you to target and style just the portion of text inside the discount tag with CSS.
![{"base64":"  ","img":{"width":2847,"height":1315,"type":"gif","mime":"image/gif","wUnits":"px","hUnits":"px","length":1143763,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message-0.gif"}}](https://read.calvincode.net/reader?url=https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message-0.gif)
> To find out which message parts you can customize, refer to the block’s documentation. It lists all message variables, like `{savingsPercentage}` in this example. You can use these variables to identify and wrap the specific text you want to style.
9. Save the changes. This assigns a unique identifier to the wrapped text, allowing you to later customize its style with CSS.
10. Access your site in the development workspace at `{workspaceName}--{accountName}.myvtex.com` and inspect the HTML element associated with the edited block’s message.
![{"base64":"  ","img":{"width":2876,"height":1576,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":534658,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message-1.png"}}](https://read.calvincode.net/reader?url=https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message-1.png)
In this example, note the message's HTML element is wrapped in a new `span` with a unique selector: `<span class="vtex-product-price-1-x-savings-discount">`.
11. [Use CSS Handles](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-css-handles-for-store-customization) to apply your styles to the new class.
12. Once you are satisfied with the changes to your Store Theme, [make your theme content publicly available](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-making-your-theme-content-public/).

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)

Was this helpful?

Yes

No

[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/vtex-io/Storefront-Guides/styling-your-store/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message.md)

[Interactively inspecting storefront blocks« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message//docs/guides/how-to-interactively-inspect-blocks-on-a-store-framework-store)[Dealing with eventsNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message//docs/guides/store-framework-dealing-with-events)

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)

ON THIS PAGE

[Before you begin](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message%23before-you-begin)

[Instructions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message%23instructions)

Was this helpful?

 Send feedback

[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/vtex-io/Storefront-Guides/styling-your-store/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message.md)

Copy page

On this page

ON THIS PAGE

[Before you begin](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message%23before-you-begin)

[Instructions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message/docs/guides/vtex-io-documentation-using-the-markers-prop-to-customize-a-blocks-message%23instructions)

On this page

[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)


[System] You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.

[User] Provide a guide on guides clicks in VTEX.

[Assistant]
Documentation

[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)

[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/api-reference)

[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/storefront-development)

[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/troubleshooting)

[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/updates/release-notes)

Guides

[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/vtex-platform-overview)

---

[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/api-usage)

---

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/getting-started)

---

Integration Guides

---

[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/catalog-integration)

---

[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/checkout-api-overview)

---

[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/master-data)

---

Payments

---

Orders

---

Logistics

---

B2B Suite

---

VTEX Sales App

---

UI Customization

---

Message Center

---

Pricing

---

Promotions

---

Infrastructure

---

Search

---

Storefront Permissions

---

[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/activity-flow)

---

[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/vtex-ads)

[Getting started with VTEX Ads API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/getting-started-with-vtex-ads-api)

[Synchronizing the catalog with VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/synchronizing-the-catalog-with-vtex-ads)

[Retrieving ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/retrieving-ads)

[Ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/ads-events)

[Understanding ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/understanding-ads-events)

[Ads events notification](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/ads-events-notification)

[Impressions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/impressions)

[Views](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/views)

[Clicks](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/clicks)

[Conversion](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/conversion)

---

VTEX Session

---

VTEX Shield

---

[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/data-protection-plus)

---

Weni by VTEX

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/storefront-development)

[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/vtex-io-apps)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/updates/release-notes)

Guides

[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/vtex-platform-overview)

---

[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/api-usage)

---

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/getting-started)

---

Integration Guides

---

[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/catalog-integration)

---

[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/checkout-api-overview)

---

[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/master-data)

---

Payments

---

Orders

---

Logistics

---

B2B Suite

---

VTEX Sales App

---

UI Customization

---

Message Center

---

Pricing

---

Promotions

---

Infrastructure

---

Search

---

Storefront Permissions

---

[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/activity-flow)

---

[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/vtex-ads)

[Getting started with VTEX Ads API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/getting-started-with-vtex-ads-api)

[Synchronizing the catalog with VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/synchronizing-the-catalog-with-vtex-ads)

[Retrieving ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/retrieving-ads)

[Ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/ads-events)

[Understanding ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/understanding-ads-events)

[Ads events notification](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/ads-events-notification)

[Impressions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/impressions)

[Views](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/views)

[Clicks](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/clicks)

[Conversion](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/conversion)

---

VTEX Session

---

VTEX Shield

---

[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/data-protection-plus)

---

Weni by VTEX

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides)

[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/vtex-ads)

[Getting started with VTEX Ads API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/getting-started-with-vtex-ads-api)

[Ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/ads-events)

[Clicks](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/clicks)

Clicks

Track ad clicks.

Click tracking is essential for measuring ad performance in VTEX Ads. This guide explains how to properly send click events when users interact with your advertisements.

## Click event rules

* Click events should be sent immediately when a user clicks on an ad.
* Each click is deduplicated within a 1-hour window per user, per device, per ad.
* Click events require both `user_id` and `session_id` for proper attribution.
* Click URLs are unique to each ad and should be obtained from the [Get ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/vtex-ads-api%23post-/v1/rma/-publisher%5Fid-) response.

> 🚧 Don't construct event URLs manually. Always use the URL provided from the `POST` [Get ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/vtex-ads-api%23post-/v1/rma/-publisher%5Fid-) request.
>
> This is extremely important to ensure long-term stability of the integration, because the parameters of the event URL may change over time, but the integration itself does not.

## Sending a click event

Use the `POST` [Track ad clicks](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/vtex-ads-api%23post-/v1/beacon/click/-ad%5Fid-) endpoint to send click events. Check the endpoint documentation for detailed information about all available fields.

Request example:

`1

POST https://events.newtail-media.newtail.com.br/v1/beacon/click/4a94bc6e-7db1-425f-8430-cb4d17488b3b?pos=1 HTTP/1.1

2

accept: application/json

3

content-type: application/json

4

5

{

6

 "user_id": "6f92d1e9-00b6-4f8b-9645-faeab321e1cc",

7

 "session_id": "5898b8d1-c250-4bb5-931b-8b9d0ee7b499"

8

}

`

Sucessful response example:

> A successful response will have HTTP code 202.

`1

{

2

 "messages": [

3

 "click will be processed soon"

4

 ]

5

}

`

Failed response example:

> A failed response will have HTTP code 422\. The error message follows the [RFC 8927](https://read.calvincode.net/reader?url=https://datatracker.ietf.org/doc/rfc8927/) format.

`1

[

2

 {

3

 "instancePath": "",

4

 "keyword": "required",

5

 "message": "must have required property 'user_id'",

6

 "params": { "missingProperty": "user_id" },

7

 "schemaPath": "#/anyOf/0/required"

8

 },

9

 {

10

 "instancePath": "",

11

 "keyword": "required",

12

 "message": "must have required property 'session_id'",

13

 "params": { "missingProperty": "session_id" },

14

 "schemaPath": "#/anyOf/1/required"

15

 },

16

 {

17

 "instancePath": "",

18

 "keyword": "anyOf",

19

 "message": "must match a schema in anyOf",

20

 "params": {},

21

 "schemaPath": "#/anyOf"

22

 }

23

]

`

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)

Was this helpful?

Yes

No

[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/VTEX Ads/getting-started-with-vtex-ads-api/ads-events/clicks.md)

[Views« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks//docs/guides/views)[ConversionNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks//docs/guides/conversion)

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)

ON THIS PAGE

[Click event rules](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/clicks%23click-event-rules)

[Sending a click event](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/clicks%23sending-a-click-event)

Was this helpful?

 Send feedback

[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/VTEX Ads/getting-started-with-vtex-ads-api/ads-events/clicks.md)

Copy page

On this page

ON THIS PAGE

[Click event rules](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/clicks%23click-event-rules)

[Sending a click event](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/clicks/docs/guides/clicks%23sending-a-click-event)

On this page

[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)


[System] You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.

[User] Provide a guide on guides faststore global tokens typography in VTEX.

[Assistant]
Documentation

[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)

[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/api-reference)

[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/storefront-development)

[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/troubleshooting)

[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/updates/release-notes)

Storefront Development

[Getting started with storefront solutions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore)

[FastStore versions and support levels](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/getting-started-faststore-versions-and-support-levels)

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/getting-started-overview)

[FastStore WebOps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/webops-dashboard)

[Headless CMS](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/headless-cms-overview)

[Developer tools and references](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/developer-tools-overview)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/styling-overview)

[Themes reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/themes-overview)

[Global tokens](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-overview)

[Colors](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-colors)

[Grid and Layout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-grid-and-layout)

[Interactive controls](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-interactive-controls)

[Refinements](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-refinements)

[Spacing](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-spacing)

[Typography](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography)

[Iconography](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/styling-icons)

[Using themes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/using-themes-overview)

[UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/components-index)

[Implementing storefront features](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/storefront-features-overview)

[FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/faststore-api-overview)

[FastStore SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/sdk-overview)

[Developing and overriding UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/developing-and-overriding-components-overview)

[Extending the FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/api-extensions-overview)

[Managing URLs with redirects and rewrite paths](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/routing-managing-urls-with-redirects-and-rewrite-paths)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/managing-performance-overview)

[SEO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/seo-overview)

[Going live](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/go-live-overview)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/troubleshooting-overview)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/store-framework)

---

(Legacy) CMS Portal

---

[Storefront best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/storefront-best-practices)

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/storefront-development)

[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/vtex-io-apps)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/updates/release-notes)

Storefront Development

[Getting started with storefront solutions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore)

[FastStore versions and support levels](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/getting-started-faststore-versions-and-support-levels)

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/getting-started-overview)

[FastStore WebOps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/webops-dashboard)

[Headless CMS](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/headless-cms-overview)

[Developer tools and references](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/developer-tools-overview)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/styling-overview)

[Themes reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/themes-overview)

[Global tokens](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-overview)

[Colors](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-colors)

[Grid and Layout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-grid-and-layout)

[Interactive controls](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-interactive-controls)

[Refinements](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-refinements)

[Spacing](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-spacing)

[Typography](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography)

[Iconography](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/styling-icons)

[Using themes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/using-themes-overview)

[UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/components-index)

[Implementing storefront features](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/storefront-features-overview)

[FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/faststore-api-overview)

[FastStore SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/sdk-overview)

[Developing and overriding UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/developing-and-overriding-components-overview)

[Extending the FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/api-extensions-overview)

[Managing URLs with redirects and rewrite paths](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/routing-managing-urls-with-redirects-and-rewrite-paths)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/managing-performance-overview)

[SEO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/seo-overview)

[Going live](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/go-live-overview)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/troubleshooting-overview)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/store-framework)

---

(Legacy) CMS Portal

---

[Storefront best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/storefront-best-practices)

---

[Storefront development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/storefront-development)

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/styling-overview)

[Global tokens](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-overview)

Typography

A standard scale and basic definitions for your text: `font family`,`weight` and `sizes`.

A standard scale and basic definitions for your text: `font family`,`weight` and `sizes`.

## Font Family

| Global Token          | Value                                                     |
| --------------------- | --------------------------------------------------------- |
| \--fs-text-face-body  | \-apple-system, system-ui, BlinkMacSystemFont, sans-serif |
| \--fs-text-face-title | var(--fs-text-face-body)                                  |

## Weights

| Global Token               | Value |
| -------------------------- | ----- |
| \--fs-text-weight-light    | 300   |
| \--fs-text-weight-regular  | 400   |
| \--fs-text-weight-medium   | 500   |
| \--fs-text-weight-semibold | 600   |
| \--fs-text-weight-bold     | 700   |
| \--fs-text-weight-black    | 900   |

## Typography Scale

Use a type scale to add rhythm to your typography and ensure consistency throughout the project.

Access [Typescale](https://read.calvincode.net/reader?url=https://type-scale.com) and choose a scale that suits the store's branding.

### Mobile Scale

* 12
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 14
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 16
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 18
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 20
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 23
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 26
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 29
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 33
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

### Desktop Scale

* 12
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 14
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 16
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 20
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 25
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 31
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 39
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 48
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* 61
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

| Global Token             | Value                                                |
| ------------------------ | ---------------------------------------------------- |
| \--fs-text-size-base     | 16px                                                 |
| \--fs-text-scale-desktop | 4px                                                  |
| \--fs-text-scale-mobile  | 2px                                                  |
| \--fs-text-size-0        | 12px                                                 |
| \--fs-text-size-1        | 14px                                                 |
| \--fs-text-size-2        | var(--fs-text-size-base)                             |
| \--fs-text-size-3        | calc(var(--fs-text-size-2) + var(--fs-scale))        |
| \--fs-text-size-4        | calc(var(--fs-text-size-3) + var(--fs-scale))        |
| \--fs-text-size-5        | calc(var(--fs-text-size-4) + var(--fs-scale))        |
| \--fs-text-size-6        | calc(var(--fs-text-size-5) + var(--fs-scale))        |
| \--fs-text-size-7        | calc(var(--fs-text-size-6) + (var(--fs-scale) \* 2)) |
| \--fs-text-size-8        | calc(var(--fs-text-size-7) + (var(--fs-scale) \* 2)) |
| \--fs-text-size-9        | calc(var(--fs-text-size-8) + (var(--fs-scale) \* 2)) |

---

## Semantical tokens

### Sizes

| Global Token                     | Value                    |
| -------------------------------- | ------------------------ |
| \--fs-text-size-title-huge       | var(--fs-text-size-8)    |
| \--fs-text-size-title-page       | var(--fs-text-size-7)    |
| \--fs-text-size-title-product    | var(--fs-text-size-4)    |
| \--fs-text-size-title-section    | var(--fs-text-size-4)    |
| \--fs-text-size-title-subsection | var(--fs-text-size-4)    |
| \--fs-text-size-title-mini       | var(--fs-text-size-4)    |
| \--fs-text-size-lead             | var(--fs-text-size-3)    |
| \--fs-text-size-menu             | var(--fs-text-size-base) |
| \--fs-text-size-body             | var(--fs-text-size-base) |
| \--fs-text-size-legend           | var(--fs-text-size-1)    |
| \--fs-text-size-tiny             | var(--fs-text-size-0)    |

### Max Lines

| Global Token         | Value |
| -------------------- | ----- |
| \--fs-text-max-lines | 2     |

---

## Adding a custom font

Using a custom font helps to keep a cohesive brand across your store. To maintain readability in your store, choose an easily readable font and the appropriate color and text size. Follow the steps below to add a custom font to your store.

1. Go to the `src` folder and create the `fonts` folder.
2. Inside the `src/fonts` folder, create a new `WebFonts.tsx` file and add a `<link>` tag for your `font-family` of choice as in the example below.

`1

/* eslint-disable @next/next/no-page-custom-font */

2

3

function WebFonts() {

4

 return (

5

 <>

6

 {/* Add a <link> tag for your font-family of choice */}

7

 <link

8

 rel="stylesheet"

9

 href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap"

10

 />

11

 </>

12

 );

13

}

14

15

export default WebFonts;

`

1. In your custom theme file, usually `src/themes/custom-theme.scss`, use the `--fs-text-face-body` token with the `font-family` you chose.

> We recommend using [fallback fonts](https://read.calvincode.net/reader?url=https://developer.chrome.com/blog/font-fallbacks/%23background) as system fonts to ensure quick rendering, consistent and readable content.

`1

@layer theme {

2

 .theme {

3

 // --------------------------------------------------------

4

 // Typography (Branding Core)

5

 // --------------------------------------------------------

6

 --fs-text-face-body: 'Inter', -apple-system, system-ui, BlinkMacSystemFont, sans-serif;

7

 }

8

}

`

1. Run `yarn dev` and check the browser to see the new `font-family` applied.

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F67270558%3Fv%3D4%26w=64%26q=75)](https://github.com/mariana-caetano)

Was this helpful?

Yes

No

[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/faststore/docs/styling/global-tokens/typography.mdx)

[Spacing« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-spacing)[IconographyNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/styling-icons)

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F67270558%3Fv%3D4%26w=64%26q=75)](https://github.com/mariana-caetano)

ON THIS PAGE

[Font Family](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23font-family)

[Weights](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23weights)

[Typography Scale](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23typography-scale)

[Mobile Scale](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23mobile-scale)[Desktop Scale](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23desktop-scale)

[Semantical tokens](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23semantical-tokens)

[Sizes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23sizes)[Max Lines](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23max-lines)

[Adding a custom font](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23adding-a-custom-font)

Was this helpful?

 Send feedback

[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/faststore/docs/styling/global-tokens/typography.mdx)

Copy page

On this page

ON THIS PAGE

[Font Family](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23font-family)

[Weights](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23weights)

[Typography Scale](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23typography-scale)

[Mobile Scale](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23mobile-scale)[Desktop Scale](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23desktop-scale)

[Semantical tokens](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23semantical-tokens)

[Sizes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23sizes)[Max Lines](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23max-lines)

[Adding a custom font](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/global-tokens-typography/docs/guides/faststore/global-tokens-typography%23adding-a-custom-font)

On this page

[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)