SalesforceCommerceCloud / commerce-sdk

https://salesforcecommercecloud.github.io/commerce-sdk/
BSD 3-Clause "New" or "Revised" License
149 stars 48 forks source link

Remove deprecated `helpers.getShopperToken` method #385

Closed johnboxall closed 6 months ago

johnboxall commented 1 year ago

Under the covers, helpers.getShopperToken() is powered by the deprecated SCAPI /actions/login method.

The method is generally unavailable and will be disabled for the majority of customers on March 31, 2023.

Customers should instead use the SLAS helpers introduced in #356:

To reduce confusion, we should remove the method!

While we're at it, we should also update the examples in the README to focus on the private helpers, which the vast majority of folks using this SDK should use: https://github.com/SalesforceCommerceCloud/commerce-sdk#sample-code


For folks looking to transition to SLAS, big picture you'll need to:

  1. Set permissions to configure SLAS in Account Manager.
  2. Create a SLAS private client for use in you BFF. You can do this programmatically, using the SLAS Admin API or manually, using the SLAS Admin UI.
  3. Update your code to call the commerce-sdk SLAS helper methods helpers.loginGuestUserPrivate and helpers.loginRegisteredUserB2Cprivate instead of helpers.getShopperToken.

To help familiarize yourself with SLAS and its concepts, checkout these docs:

A few more notes for your implementation:

git2gus[bot] commented 1 year ago

This issue has been linked to a new work item: W-12733508

joeluong-sfcc commented 6 months ago

getShopperToken has been removed with the latest release, v3.0.0: https://github.com/SalesforceCommerceCloud/commerce-sdk/releases/tag/v3.0.0