Cannot use btoa in custom api auth for self-hosted retool

Hi all,

It appears as though this is supported for Cloud organizations as stated by the reool team here: Custom API Authentication should allow the use of btoa() - #11 by Kabirdas

When using it with self-hosted retool I get the error:
Javascript Request in Step 2 failed : Error with sandbox evaluation
Step 2 is the javascript portion as follows:

const string = + ":" + form1.password;
return btoa(string);

Is there a timeline of if or when this would be added to self-hosted retool?
If it won't be added are there any workarounds?

We are on retool version 3.33.17

It looks like that error is thrown when you try to use btoa() in resource settings. Try using use Buffer.from("string").toString('base64') instead.

1 Like

Thanks, that works perfectly!

1 Like

Fantastic! So glad to hear :raised_hands: