javascript to base 64 encode api key to auth header