Monetization Flows
Get Current User information
You can leverage the currentUser
API to obtain the information for the currently logged-in user, for instance, if you want to use their userId
to validate in a monetization flow.
See the example below and refer to the related SDK Reference section and the licensed-addon code sample, which shows how you can utilize the hash of the user ID to integrate your add-on with licensing and payment services.
Example
Output
Copied to your clipboardimport addOnUISdk from "https://new.express.adobe.com/static/add-on-sdk/sdk.js";addOnUISdk.ready.then(async () => {validateUser(await addOnUISdk.app.currentUser.userId());});validateUser(userId: string) {...}
Current Userid: 3cda976828a4a90d13b0f38b1f8a59b1d6845cccfc48037fb30bb75d3ef67d36