Lets you store non-sensitive configuration data as non-encrypted strings.
Application configuration, paths.
By storing secrets and variables in RudderStack’s credential store, you can avoid hardcoding sensitive information in your transformations and avoid any security risks.
Access credential store
Go to Settings > Workspace > Credentials to access the credential store and create your secrets and variables.
You must have Admin privileges to create, edit, and delete secrets and variables.
Create secrets
Go to the Secrets tab of the credential store.
Click New secret.
Enter the secret name and value.
Secret names can contain only alphanumeric characters and underscores and they cannot start with a number.
Click Add to save the secret.
To edit a secret, click the edit icon, enter the new secret value, and click Save. Note that the previous secret value will not be visible.
Create variables
Go to the Variables tab of the credential store.
Click New variable.
Enter the variable name and value.
Variable names must contain only alphanumeric characters and underscores and they cannot start with a number.
Click Add to save the variable.
To edit a variable, click the edit icon, enter the new value, and click Save.
Use credentials in transformations
Once you create the credentials in the credential store, you can easily reuse them by referencing them within the getCredential() function in your transformations.
Note the following while using credentials in transformations:
Any workspace member can use the credentials in their transformations.
The following example highlights the usage of credentials within a fetchV2 function:
exportasyncfunctiontransformEvent(event,metadata){consturl=getCredential('URL');// Variable named URL
constid=getCredential('ID');// Credential named ID
constauthToken=getCredential('authToken');// Secret named authToken
constresponse=awaitfetchV2(`${url}/${id}`,{headers:{Authorization:"Bearer "+authToken}});event.value=response.bodyreturnevent;}
Considerations for using getCredential function
Note the following scenarios and the expected behavior when using the getCredential function:
Scenario
Behavior (JavaScript)
Behavior (Python)
getCredential function called without a key
You will get the following error:
TypeError: Key should be valid and defined
You will get the following error:
TypeError('Key should be valid and defined')
getCredential function called with multiple arguments
Credential function takes the first argument as the key.
Credential function takes the first argument as the key.
getCredential function called with a non-string key (for example, integers, Boolean)
No credential value is passed and the event remains unchanged.
Credential value is passed as null.
getCredential function called with a non-existent key
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.