How To : Get a user's gigya profile using their gigya uid - Gigya Drupal 8/9
This is technical document to serve an implementation reference by Developer. We assume that you have the gigya PHP SDK and gigya raas drupal 8 module installed in your project.
We’ve had multiple issues with getting user’s profiles or showing users information on the site – This is because of the limitation of the Gigya Client Side - Web SDK . The user information have to be queried server side and this is how:
You need to instantiate the helper class:
$helper = new Drupal\gigya\Helper\GigyaHelper(); $api = $helper->getGigyaApiHelper();
You can then fetch the user Gigya Account by calling fetchGigyaAccount($uid) this takes the gigya user id as a parameter
FetchGigyaAccount throws an exception:
Remember to catch this in your code to avoid critical errors.