Authentication
Retrieve current user
Retrieve the public profile information for the currently logged in user
Verify and extract the user’s ID from a JWT token passed in the x-whop-user-token
header passed to iframe apps on your backend.
Ensure you have setup your whop SDK client on the server
Not using the Whop TS SDK?
How to authenticate users in other languages
How to authenticate users in other languages
In order to retrieve the current user’s ID, you need to decrypt a JWT token that is stored in the x-whop-user-token
header. VerifyUserToken
is a helper function in our TS SDK that decodes the JWT token and returns the user’s ID.
If are using a different framework and do not have access to the Typescript Whop SDK, you will need to implement your own JWT decoding logic. Here is an example of how to do this in Ruby on Rails:
Ruby on Rails