Closed hani-iterable closed 6 months ago
Also, this is kind of a late catch, but can we remove instances of manually setting email and user id on local storage in the Web SDK source? We already have methods that customers/devs use to do that. You can see we have a setEmail
and setUserId
on the initialize()
method we are already using for embedded in the react-example app.
We should just be able to fetch from local storage without having to set it, except for when setUser
and setUserId
is called.
See the method definition in authorization.ts
. To use it, you would just call
const { setEmail, setUserId } = initialize(...)
initialize()
@mprew97 Got it, you're asking about the use of the 'initialize()' method. Do we need to pass the userID from the Sample app when calling any method related to Embedded messages, or is there another way to handle this?
initialize()
@mprew97 Got it, you're asking about the use of the 'initialize()' method. Do we need to pass the userID from the Sample app when calling any method related to Embedded messages, or is there another way to handle this?
@hani-iterable For API requests, once you call setEmail or setUserId, those automatically get tacked on to all requests. In authorization.ts, see lines 237 - 328. We intercept any request using baseAxiosRequest and add the email or userId to the req.
JIRA Ticket(s) if any
Description