Best approach to calculate custom auth header

Hi there,
I’d need to access the Emarsys API. They use some custom authentication header with sha1, base64 and date formatting. It’s described in https://dev.emarsys.com/v2/before-you-start/authentication#compute-digest .

Is something like this possible within a FunctionItem node, or do I have to create my own node to be able to access the crypt libraries, they propose?

Thanks, Björn

Welcome to the community @brafreider!

That is possible in the Function-Node if you set the environment variable NODE_FUNCTION_ALLOW_BUILTIN accordingly. So for example:

export NODE_FUNCTION_ALLOW_BUILTIN=crypto

You can find the documentation here:

When you do that you can require that module normally in the Function-Node.

Hi @jan,
thanks for the hint. I had overseen this config option. Maybe it’s worth, crosslinking it from the function- and functionItem- node description.

Great work!

Cheers,
Björn