Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Subscriptions
English French
English French

How to get user data such as email or name from the Piano SDK

You can obtain user data using the JWT token with the Piano PHP SDK and the mobile SDK. Individual SDK libraries are available here.

The JWT is stored in the __utp cookie. In the browser, read __utp from document.cookie and decode its payload (base64) as in the example below:

atob(utpCookieValue.split('.' )[1]);

This returns the JWT claims as a JavaScript object.

In PHP, read the cookie from $_COOKIE['__utp']. First-party cookies are sent with backend requests.

For the mobile SDK, decrypt the JWT to obtain the user details.

Last updated: