Skip to content

Conversation

@jackmacaa
Copy link
Contributor

Description of the proposed changes
Updated the details about customerImpersonationToken in the root readMe

@jackmacaa jackmacaa requested a review from a team as a code owner April 2, 2025 05:36
@jackmacaa jackmacaa requested a review from tvhees April 2, 2025 05:36

The customer impersonation token is used along with the header `x-bc-customer-id: {bcCustomerId}` to make customer specific requests to BC Graphql API. the alternative is to use the `SHOP_TOKEN` cookie that is returned after making the login mutation to BC Graphql.

To create the token the `createCustomerImpersonationToken` function makes a POST request to BigCommerce's API endpoint `/v3/storefront/api-token-customer-impersonation`. The token is cached using the `getDataFromMeshCache` utility function. By default, the token is cached for 24 hours (86400000 milliseconds) as defined in `CACHE_ITEMS_TTL`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section should be focused on how to get a token using the BigCommerceTokenService, not implementation details. You might need to merge in the version/bigcommerce-1.1.0 branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to merge version/bigcommerce-1.1.0 into main?
Or we want to merge this readMe update into version/bigcommerce-1.1.0?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge version/bigcommerce-1.1.0 in to chore/MI-108-update-readMe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So i should have originally branched from version/bigcommerce-1.1.0 and then we would merge back into it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters? Just need to get this set of diffs to be relative to the latest state of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants