[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 offer management sdk 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/offer-management-sdk/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/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/offer-management-sdk/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/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/offer-management-sdk/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/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/offer-management-sdk/updates/release-notes)

Guides

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

---

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

---

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

---

Integration Guides

[Back office integration guide (ERP/PIM/WMS)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/erp-integration-guide)

[Customer Credit](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/customer-credit-integration-guide)

[External Marketplace](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/external-marketplace-integration-guide)

[External Seller](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/external-seller-integration-guide)

[Gift Card](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/gift-card-integration-guide)

[Headless commerce](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/headless-commerce)

[Login (SSO)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/login-integration-guide)

[Punchout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/punchout)

[Offer Management Integration Guide](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/sent-offers-integration-guide-connectors)

[Offer Management SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk)

[Payments](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/payments-integration-guide)

[Search Protocol](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/search-integration-guide)

[Session Manager](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/session-manager)

[Tax Service](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/tax-service-integration-guide)

[Pricing Hub](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/pricing-hub)

[reCAPTCHA](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/recaptcha)

---

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

---

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

---

[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/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/offer-management-sdk/docs/guides/activity-flow)

---

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

---

VTEX Session

---

VTEX Shield

---

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

---

Weni by VTEX

---

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

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

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

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

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

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

---

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

Guides

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

---

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

---

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

---

Integration Guides

[Back office integration guide (ERP/PIM/WMS)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/erp-integration-guide)

[Customer Credit](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/customer-credit-integration-guide)

[External Marketplace](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/external-marketplace-integration-guide)

[External Seller](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/external-seller-integration-guide)

[Gift Card](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/gift-card-integration-guide)

[Headless commerce](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/headless-commerce)

[Login (SSO)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/login-integration-guide)

[Punchout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/punchout)

[Offer Management Integration Guide](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/sent-offers-integration-guide-connectors)

[Offer Management SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk)

[Payments](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/payments-integration-guide)

[Search Protocol](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/search-integration-guide)

[Session Manager](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/session-manager)

[Tax Service](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/tax-service-integration-guide)

[Pricing Hub](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/pricing-hub)

[reCAPTCHA](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/recaptcha)

---

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

---

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

---

[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/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/offer-management-sdk/docs/guides/activity-flow)

---

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

---

VTEX Session

---

VTEX Shield

---

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

---

Weni by VTEX

---

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

Integration Guides

[Offer Management Integration Guide](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/sent-offers-integration-guide-connectors)

[Offer Management SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk)

Offer Management SDK

> The Offer Management module has been discontinued and is no longer supported. The module has been replaced by [Offer Status](https://read.calvincode.net/reader?url=https://help.vtex.com/en/tutorial/status-de-anuncios-beta--2OE87wU26F7lApl99OdwvJ). To learn more, visit the [announcement](https://read.calvincode.net/reader?url=https://help.vtex.com/en/announcements/modulo-status-dos-anuncios-para-integracoes-com-marketplaces-vtex--1EeGgit1Brq3mmm8qhv2m3).

The [Offer Management](https://read.calvincode.net/reader?url=https://help.vtex.com/en/tutorial/offer-management--7MRb9S78aBdZjFGpbuffpE) allows sellers to track the sending and syncing of their offers in marketplaces integrated with their store. The feature helps sellers identify updates and solve errors in their offers during the sending process, guaranteeing they were sent to the marketplace and synced correctly. In VTEX, an offer is an SKU from a seller that has been sent to a marketplace and whose price and inventory information have been configured.

The current document is a Software Development Kit (SDK) created to facilitate the integration between a connector and Offer Management. The SDK includes the implementation of Offer Management’s main features and a .NET library via MyGet.

The integration using this SDK follows the same concepts presented in the [Offer Management Integration Guide](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-rest-api/docs/sent-offers-integration-guide-connectors):

| Concept     | Description                                                                                |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| Feed        | The feedId attribute created by the connector will identify sellers’ feeds with a channel.                                                          |
| Interaction | For every action that happens to an offer, whether it is a status notification or a price update, the connector creates an interaction about it.    |
| Logs        | Logs are the granular details of actions that happen within an interaction, and they are organized in a timeline. Logs registers last for ten days. |

Offer Management works with the creation of a feed, followed by the creation of interactions and logs. After the log is created, it is necessary to close the interaction, and that process is what makes an offer update visible for sellers in Offer Management’s UI.

These SDK is organized in the following sections:

1. [Installing dependencies](#installing-dependencies)
2. [Offer Management APIs](#offer-management-apis)
3. [Unified contract](#unified-contract)
4. [Integration flows](#integration-flows)

## Installing dependencies

**Step 1 -** Open the terminal and add the package to the project dependencies:

`1

<PackageReference Include=\"SentOffers.SDK\" Version=\"0.0.4\" />

`

**Step 2 -** Inject dependencies in the project:

`1

services.AddSingleton<ISentOffersClient, SentOffersClient>();

`

## Offer Management APIs

All of the APIs responses are contained in the object `SentOffersResponse`, which can be used to check if a transaction was successful or presented an error. All errors are listed in the `errors` attribute.

This section is organized as below:

* [Installing dependencies](#installing-dependencies)
* [Offer Management APIs](#offer-management-apis)
   * [Authentication](#authentication)
   * [Create feed](#create-feed)
   * [Deactivate feed](#deactivate-feed)
   * [Create interaction](#create-interaction)
   * [Create log](#create-log)
* [Unified contract](#unified-contract)
* [Integration flows](#integration-flows)
   * [Catalog integration](#catalog-integration)
   * [Price update](#price-update)
   * [Inventory update](#inventory-update)
   * [Integration errors](#integration-errors)

> This SDK does not reference all the APIs related to Offer Management, however, they can be found in VTEX API Reference under **Marketplace APIs > [Offer Management](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-rest-api/reference/createchannel)**.

### Authentication

Authentication in Offer Management works as in VTEX REST APIs, as it can be seen in [Authentication](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/getting-started-authentication). Through the `SentOffersCredentials` class, the connector can send information about AppKey, AppToken and VTEX IO token.

### Create feed

The creation of a feed establishes the connection between the seller's [affiliate](https://read.calvincode.net/reader?url=https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials%5F187) ID and the marketplace’s ID, which corresponds to the attribute `Id` (also referred to as `feedId`).

`1

SentOffersResponse <FeedCreateResponseDto> response;

2

3

response = await soClient.CreateFeedAsync(

4

 "account",

5

 new FeedCreateDTO

6

 {

7

 Id = "vtex.marketplace",

8

 SalesChannel = "1",

9

 AffiliatedId = "AFL"

10

 },

11

 credentials

12

)

`

### Deactivate feed

When a feed is deactivated, all data related to the marketplace is removed from Offer Management’s UI, including channels, offers, interactions, and errors. Deactivating a feed does not mean deleting information, and the seller can restore the data through the endpoint [Activate Feed](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-rest-api/reference/create-feed).

In order to [delete a feed](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-rest-api/reference/deactivate-feed), implement the code below:

`1

var response = await soClient.DeleteFeedAsync(

2

 "account",

3

 “vtex.marketplace”,

4

 “credentials”

5

)

`

### Create interaction

An interaction should be created before the connector’s integration flow. The reason is that for any flow it will be necessary to inform the interaction context, whether it is a setup or a synchronization.

To create an interaction, do the following:

`1

var response = await soClient.CreateInteractionAsync(

2

 "account",

3

 "vtex.makertplace",

4

 new InteractionCreateDTO

5

 {

6

 StartDate = Datetime.UtcNow.ToString(),

7

 Source = InteractionSourceType.seller,

8

 Origin = OriginType.inventory,

9

 Context = InteractionContextType.sync

10

 },

11

 credentials

`

### Create log

Logs can be created as the following:

`1

CreateLogDTO log = new()

2

{

3

 Description = "sdk test",

4

 Type = "Info",

5

 Agent = "channel",

6

 Date = DateTime.Now.ToString(),

7

 Data = new CreateLogDataRequest() { Status = "Sending" }

8

};

9

10

string skuId = "1";

11

string interactionId = "3DB3542A2C93412298AC95964A66A995";

12

13

var result = await _soClient.CreateLogAsync(

14

 "account",

15

 "vtex.marketplace",

16

 skuId,

17

 interactionId,

18

 log, credentials

19

 )

`

## Unified contract

In order to facilitate the integration with Offer Management, all the contracts presented in the previous sections were grouped in a single contract, that does the following:

1. Creates an interaction.
2. Receives a log.
3. Closes an interaction.

> We highly recommend using this route when integrating with [Offer Management](https://read.calvincode.net/reader?url=https://help.vtex.com/en/tutorial/gestao-de-anuncios--7MRb9S78aBdZjFGpbuffpE). Other specific routes should be used only when the unified contract does not meet the connector's needs.

`1

UnifiedInteractionCreateDTO unifiedContract = new()

2

{

3

 Date = "2021-10-15T16:20:19.561754Z",

4

 Source = "channel",

5

 Origin = "catalog",

6

 Context = "ongoing",

7

 Description = "Info example",

8

 Type = "Info",

9

 Agent = "My-Conector"

10

};

11

12

string skuId = "1";

13

14

var result = await _soClient.CreateUnifiedInteractionAsync(

15

 "account",

16

 "vtex.marketplace",

17

 skuId,

18

 unifiedContract,

19

 credentials

20

)

`

## Integration flows

If the [unified contract](#unified-contract) was not a solution for the connector, then this section’s specific flows must be implemented.

In order to integrate a VTEX seller’s SKU with a marketplace, the connector has to implement the flows as in the list below:

* [Catalog integration](#catalog-integration)
* [Price update](#price-update)
* [Inventory update](#inventory-update)
* [Integration error](#integration-errors)\[block:callout\]

> After the creation of the feed, each interaction in Offer Management must start with the same `OriginType` attribute used in the integration flow that is operating, whether it is about inventory, price or catalog.

### Catalog integration

In order to create catalog integration, do as the following example:

`1

CreateLogDTO log = new()

2

{

3

 Description = "SKU enviado ao marketplace",

4

 Type = "Failure",

5

 Agent = "channel",

6

 Date = DateTime.Now.ToString(),

7

 Errors = new CreateLogErrorRequest[] {

8

 new CreateLogErrorRequest{

9

 Code = “

10

 }

11

 }

12

};

13

14

string skuId = "1";

15

string interactionId = "3DB3542A2C93412298AC95964A66A995";

16

var result = await _soClient.CreateLogAsync(

17

 "account",

18

 "vtex.marketplace",

19

 skuId,

20

 interactionId,

21

 log, credentials

22

)

`

### Price update

In order to update price in the integration, do as the following example:

`1

CreateLogDTO log = new()

2

{

3

 Description = "SKU enviado ao marketplace",

4

 Type = "Info",

5

 Agent = "channel",

6

 Date = DateTime.Now.ToString(),

7

 Data = new CreateLogDataRequest

8

 Status = "Synchronized",

9

 Price = 124,

10

 Currency = "BRL"

11

 };

12

13

string skuId = "1";

14

string interactionId = "3DB3542A2C93412298AC95964A66A995";

15

16

var result = await _soClient.CreateLogAsync(

17

 "account",

18

 "vtex.marketplace",

19

 skuId,

20

 interactionId,

21

 log, credentials

22

)

`

### Inventory update

In order to update inventory in the integration, do as the following example:

`1

CreateLogDTO log = new()

2

{

3

 Description = "SKU enviado ao marketplace",

4

 Type = "Info",

5

 Agent = "channel",

6

 Date = DateTime.Now.ToString(),

7

 Data = new CreateLogDataRequest

8

 Status = "Synchronized",

9

 Inventory= 8

10

 };

11

12

string skuId = "1";

13

string interactionId = "3DB3542A2C93412298AC95964A66A995";

14

15

var result = await _soClient.CreateLogAsync(

16

 "account",

17

 "vtex.marketplace",

18

 skuId,

19

 interactionId,

20

 log, credentials

21

)

`

### Integration errors

To integrate errors cases, do as the following example:

`1

string skuId = "1";

2

string interactionId = "3DB3542A2C93412298AC95964A66A995";

3

4

var result = await _soClient.CreateLogAsync(

5

 "account",

6

 "vtex.marketplace",

7

 skuId,

8

 interactionId,

9

 log, credentials

10

)

`

Contributors

3

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

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

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

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/Integration-Guides/sent-offers-integration-guide-connectors/offer-management-sdk.md)

[Offer Management Integration Guide« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk//docs/guides/sent-offers-integration-guide-connectors)[PaymentsNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk//docs/guides/payments-integration-guide)

Contributors

3

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

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

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

ON THIS PAGE

[Installing dependencies](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23installing-dependencies)

[Offer Management APIs](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23offer-management-apis)

[Authentication](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23authentication)[Create feed](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23create-feed)[Deactivate feed](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23deactivate-feed)[Create interaction](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23create-interaction)[Create log](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23create-log)

[Unified contract](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23unified-contract)

[Integration flows](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23integration-flows)

[Catalog integration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23catalog-integration)[Price update](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23price-update)[Inventory update](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23inventory-update)[Integration errors](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23integration-errors)

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/Integration-Guides/sent-offers-integration-guide-connectors/offer-management-sdk.md)

Copy page

On this page

ON THIS PAGE

[Installing dependencies](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23installing-dependencies)

[Offer Management APIs](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23offer-management-apis)

[Authentication](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23authentication)[Create feed](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23create-feed)[Deactivate feed](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23deactivate-feed)[Create interaction](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23create-interaction)[Create log](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23create-log)

[Unified contract](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23unified-contract)

[Integration flows](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23integration-flows)

[Catalog integration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23catalog-integration)[Price update](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23price-update)[Inventory update](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23inventory-update)[Integration errors](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/offer-management-sdk/docs/guides/offer-management-sdk%23integration-errors)

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 cart cart provider 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/cart-cart-provider/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/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/cart-cart-provider/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/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/cart-cart-provider/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/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/cart-cart-provider/updates/release-notes)

Storefront Development

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

---

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

[FastStore versions and support levels](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/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/cart-cart-provider/docs/guides/faststore/getting-started-overview)

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

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

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

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

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

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

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

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

[Analytics](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/analytics-overview)

[Cart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-overview)

[useCart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-use-cart)

[CartProvider](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-cart-provider)

[Search](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/search-overview)

[Session](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/session-overview)

[Developing and overriding UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/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/cart-cart-provider/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/cart-cart-provider/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/cart-cart-provider/docs/guides/faststore/managing-performance-overview)

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

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

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

---

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

---

(Legacy) CMS Portal

---

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

---

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

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

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

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

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

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

---

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

Storefront Development

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

---

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

[FastStore versions and support levels](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/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/cart-cart-provider/docs/guides/faststore/getting-started-overview)

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

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

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

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

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

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

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

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

[Analytics](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/analytics-overview)

[Cart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-overview)

[useCart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-use-cart)

[CartProvider](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-cart-provider)

[Search](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/search-overview)

[Session](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/session-overview)

[Developing and overriding UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/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/cart-cart-provider/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/cart-cart-provider/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/cart-cart-provider/docs/guides/faststore/managing-performance-overview)

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

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

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

---

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

---

(Legacy) CMS Portal

---

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

---

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

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

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

[Cart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-overview)

CartProvider

`CartProvider` is a React component that wraps an entire app, providing it with the necessary context to manage shopping cart operations. The component handles actions in the cart such as adding, removing, and updating items, and ensures the cart state is consistent across the application. For more details on these actions, see [useCart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/TBD).

## Import

`1

import { CartProvider } from '@faststore/sdk'

`

## Usage

The following example shows how to wrap your application with `CartProvider` to manage shopping cart operations:

`1

import { CartProvider } from '@faststore/sdk'

2

3

function App () {

4

 return (

5

 <CartProvider mode="pure">

6

 {children}

7

 </CartProvider>

8

 )

9

}

`

The `mode` property is required and determines how cart operations are handled. It can be set to either `optimistic` or `pure`:

`optimistic`: Updates the cart optimistically, assuming the operation will succeed.`pure`: Waits for the operation to complete before updating the cart.

## Props

The `CartProvider` component accepts the following properties and functions:

| Variable name   | Type                                      | Description                                                                                |
| --------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| mode (required) | optimistic or pure                        | Defines how cart operations are processed.                                                                                |
| initialCart     | Cart                                      | Initial cart state used before hydrating it from IndexedDB. If not provided, the cart will start empty.                                                                  |
| namespace       | string                                    | A unique identifier for the cart. This is used to avoid collisions in IndexedDB when multiple carts are used in the same application.                                    |
| onItemAdd       | (newItem: Item, oldItem?: Item) => void   | Callback function called when an item is added to the cart.                                                                                |
| onItemRemove    | (item?: Item) => void                     | Callback function called when an item is removed from the cart.                                                                                |
| onItemUpdate    | (newItem: Item, oldItem?: Item) => void\` | Callback function called when an item is updated.                                                                                |
| onValidateCart  | (cart: Cart) => Promise<Cart /> null>     | Callback function called whenever the cart changes. This is only available in optimistic mode and can be used to validate or modify the cart before changes are applied. |

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/_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/sdk/cart/cart-provider.mdx)

[useCart« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-use-cart)[SearchNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/search-overview)

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/_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

[Import](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-cart-provider%23import)

[Usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-cart-provider%23usage)

[Props](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-cart-provider%23props)

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/sdk/cart/cart-provider.mdx)

Copy page

On this page

ON THIS PAGE

[Import](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-cart-provider%23import)

[Usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-cart-provider%23usage)

[Props](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/cart-cart-provider/docs/guides/faststore/cart-cart-provider%23props)

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 collecting user session data 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-collecting-user-session-data/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/faststore)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework)

[Store Theme](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-store-theme)

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/getting-started-3)

Concepts

[Building pages](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-building-pages)

[Using components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-using-components)

[Using advanced layouts](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/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-collecting-user-session-data/docs/guides/store-framework-working-with-site-editor)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-styling)

[Dealing with events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-dealing-with-events)

[Collecting user session data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data)

[Cleaning cart data on log out](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-cleaning-cart-data-on-log-out)

[Improving filter navigator experience](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-improving-filter-navigator-experience)

[Using events to trigger side effects on store components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-using-events-to-trigger-side-effects-on-store-components)

[Configuring Analytics (Google Tag Manager)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/docs/guides/vtex-io-multi-language-stores)

[Routing](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-routing)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/docs/guides/storefront-best-practices)

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/storefront-development)

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

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/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-collecting-user-session-data/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/faststore)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework)

[Store Theme](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-store-theme)

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/getting-started-3)

Concepts

[Building pages](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-building-pages)

[Using components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-using-components)

[Using advanced layouts](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/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-collecting-user-session-data/docs/guides/store-framework-working-with-site-editor)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-styling)

[Dealing with events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-dealing-with-events)

[Collecting user session data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data)

[Cleaning cart data on log out](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-cleaning-cart-data-on-log-out)

[Improving filter navigator experience](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-improving-filter-navigator-experience)

[Using events to trigger side effects on store components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-using-events-to-trigger-side-effects-on-store-components)

[Configuring Analytics (Google Tag Manager)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/docs/guides/vtex-io-multi-language-stores)

[Routing](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-routing)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/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-collecting-user-session-data/docs/guides/storefront-best-practices)

---

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/storefront-development)

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework)

[Dealing with events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/store-framework-dealing-with-events)

[Collecting user session data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data)

Collecting user session data

VTEX tracks users' sessions within apps by storing session information in a namespace. Each app has its own namespace, and only the app can modify its session properties. For example, the `vtex.search-session` app manages the `search` namespace.

This guide explains how to detect session changes in a specific namespace and respond to them programmatically.

> Learn more about the [Session manager](https://read.calvincode.net/reader?url=https://help.vtex.com/tutorial/using-session-manager-to-track-browsing-sessions-in-vtex-stores--1pA0tqsD4BFnJYhQ7ORQBd) and check the [Session manager API reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/session-manager-api%23overview). For a practical use case, refer to the [Cart cleanup guide](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-cleaning-cart-data-on-log-out).

## Session Manager API overview

To view a store's current session data and structure, open your browser and navigate to:

`1

https://{workspace}–{accountName}.myvtex.com/api/sessions?items=*

`

> Only use `items=*` during development. Never use it in production, as it retrieves all session data. For production, retrieve specific session data by specifying the required namespace and properties (e.g., `items=authentication.storeUserEmail,checkout.orderFormId`).

## Before you begin

Before starting, ensure you have the following:

* [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): Install and configure the VTEX IO CLI.
* Existing app: If you are building a new app, run `vtex init` and select `service-example` to create a new app using the [node builder](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-node-builder). Make sure the app vendor is set to the appropriate account.

## Instructions

### Step 1 - Configuring the `vtex.session` builder

1. Open your app's `manifest.json` file and add `vtex.session` under the `builders` section:
manifest.json
`1
"builders": {
2
 "node": "7.x",
3
 "docs": "0.x",
4
 "vtex.session": "0.x"
5
},
`
2. In the root directory of your project, create a folder named `vtex.session` and add the `configuration.json` to it. This file defines the session behavior for your app.
3. Inside `configuration.json`, define the session configuration using the following structure:
configuration.json
`1
{
2
 "APP-NAME": {
3
 "input": {
4
 "NAMESPACE": ["VALUE"]
5
 },
6
 "output": {
7
 "NAMESPACE": ["VALUE"]
8
 }
9
 }
10
}
`

| Parameter | Description                                                                                |
| --------- | ------------------------------------------------------------------------------------------- |
| APP-NAME  | App's name without the vendor prefix. For example, session-watcher-demo.                    |
| input     | Object containing the key-value pairs corresponding to session changes you want to monitor. |
| output    | Object containing the key-value pairs for the session changes you want to apply.            |

#### Example

In the following example, the app listens for changes in the `authentication` namespace to retrieve the user's email (`storeUserEmail`). It also monitors the `checkout` namespace to track the `orderFormId`. The output stores a property called `demo` in the `public` namespace.

`1

{

2

 "session-watcher-demo": {

3

 "input": {

4

 "authentication": ["storeUserEmail"],

5

 "checkout": ["orderFormId"]

6

 },

7

 "output": {

8

 "public": ["demo"]

9

 }

10

 }

11

}

`

### Step 2 - Setting up the `transform` handler

The `vtex.session` builder detects changes in the `input` values of the `configuration.json` file and sends a `POST` request to the public endpoint (`/_v/APP-NAME/session/transform`) whenever a change occurs. All values listed under `input` are sent in the request, even if not all values have changed.

To set up this endpoint, take the following steps:

1. Open the `./node/services.json` file and add a route containing `path` and `public` under the `routes` property. For example:
services.json
`1
"routes": {
2
 "clearCart": {
3
 "path": "/_v/session-watcher-demo/session/transform",
4
 "public": true
5
 }
6
}
`
2. Create the `node/resolvers/index.ts` file and define the handler function for processing session changes. This function will respond with the expected output defined in the `configuration.json`. Take the following example and note that the handler receives a `Context` that gives access to the request body. The handle should respond as a JSON with the object expected on the `output` definition.
node/resolvers/index.ts
`1
/* eslint-disable no-console */
2
import { json } from 'co-body'
3

4
export const resolvers = {
5
 Routes: {
6
 clearCart: async (ctx: Context) => {
7
 const { req } = ctx
8

9
 const body: any = await json(req)
10
 const email = body?.authentication?.storeUserEmail?.value ?? null
11

12
 console.log('clearCart =>', body)
13

14
 ctx.set('Content-Type', 'application/json')
15
 ctx.set('Cache-Control', 'no-cache, no-store')
16

17
 const res = {
18
 public: {
19
 demo: {
20
 value: email ? 'User Authenticated' : 'User not authenticated',
21
 },
22
 },
23
 }
24

25
 ctx.response.body = res
26
 ctx.response.status = 200
27
 },
28
 },
29
}
`
3. In the `./node/index.ts` file, import the handler function file ( `node/reseolvers/index.ts`) and load it into the Service.
node/index.ts
`1
import { resolvers } from ‘./resolvers’
2
…
3
// Export a service that defines route handlers and client options.
4
export default new Service{{
5
 clients,
6
 routes: resolvers.Routes,
7
})
`

### Step 3 - Testing your changes

1. Link your app to a development workspace by running `vtex link`.
2. Monitor the terminal for logs indicating the session changes. Once a user logs in or out, you should see logs like `clearCart =>` with the body of the request.
![{"base64":"  ","img":{"width":1714,"height":186,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":140834,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-collecting-user-session-data-2.png"}}](https://read.calvincode.net/reader?url=https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-collecting-user-session-data-2.png)

You can also check the session data changes by accessing the following URL:

`1

https://{workspace}–{accountName}.myvtex.com/api/sessions?items=public.demo

`

The response might look like this:

`1

{

2

 "id": "cca40248-a3f9-4a60-baf1-b67de92cd8a",

3

 "namespaces": {

4

 "public": {

5

 "demo": {

6

 "Value": "User Authenticated"

7

 }

8

 }

9

 }

10

}

`

> The `vtex.session` builder may take a few minutes to initialize after linking the app. If logs don’t appear immediately, please wait a few minutes.

For a complete example, [download the code](https://read.calvincode.net/reader?url=https://raw.githubusercontent.com/vtexdocs/dev-portal-content/refs/heads/main/files/vtex-io/session-watcher.zip).

Contributors

3

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

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F7026595%3Fv%3D4%26w=64%26q=75)](https://github.com/henriquessb)

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F59752868%3Fv%3D4%26w=64%26q=75)](https://github.com/yangenmanuel)

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/concepts-1/vtex-io-documentation-collecting-user-session-data.md)

[Dealing with events« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data//docs/guides/store-framework-dealing-with-events)[Cleaning cart data on log outNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data//docs/guides/vtex-io-documentation-cleaning-cart-data-on-log-out)

Contributors

3

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

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F7026595%3Fv%3D4%26w=64%26q=75)](https://github.com/henriquessb)

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F59752868%3Fv%3D4%26w=64%26q=75)](https://github.com/yangenmanuel)

ON THIS PAGE

[Session Manager API overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23session-manager-api-overview)

[Before you begin](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23before-you-begin)

[Instructions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23instructions)

[Step 1 - Configuring the vtex.session builder](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23step-1-configuring-the-vtexsession-builder)[Step 2 - Setting up the transform handler](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23step-2-setting-up-the-transform-handler)[Step 3 - Testing your changes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23step-3-testing-your-changes)

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/concepts-1/vtex-io-documentation-collecting-user-session-data.md)

Copy page

On this page

ON THIS PAGE

[Session Manager API overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23session-manager-api-overview)

[Before you begin](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23before-you-begin)

[Instructions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23instructions)

[Step 1 - Configuring the vtex.session builder](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23step-1-configuring-the-vtexsession-builder)[Step 2 - Setting up the transform handler](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23step-2-setting-up-the-transform-handler)[Step 3 - Testing your changes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-collecting-user-session-data/docs/guides/vtex-io-documentation-collecting-user-session-data%23step-3-testing-your-changes)

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=)