How to encode ConvertAPI secret while converting

28 views Asked by At

I am using convertAPI in angular as javascript let convertApi = ConvertApi.auth({ secret: 'xxxxxxxxxxxxx' }); The secret is visible in the network tab but I want to make it secure.

So, I just want to make it encoded and I use atob() to encode it but convertAPI rejected the secret as it is not correct. How can I secure the secret?

1

There are 1 answers

0
Jonas On

Base64 will not help to hide your secret. If someone is looking for your secret, they will decode it. To secure your credentials you should use tokens.

let convertApi = ConvertApi.auth({ apiKey: 'xxxxxxxxx', token: 'xxxxxxx' });

Read more about the tokens: https://www.convertapi.com/doc/auth#token