How to retrieve aws session token from pre-request script in Postman?

I’m looking for a way to retrieve the aws session token by writing a pre-request script. What is the recommended way of doing it?