New Secrets Feature

Hello TagoIO community!

We are excited to announce a new feature called Secrets! Our goal with secrets is to allow you to protect confidential information you might need to use within your Analysis. Secrets allows you to add confidential information like API Keys and Tokens. This way you can stay at ease knowing your keys and tokens are safe and secure.

Here’s a video showing off what Secrets is capable of:

To learn more about Secrets and to start using it in your Analysis, visit our article about it.

Thank you for being a part of the TagoIO community!

Hey, Freddy!

How to edit a secret via SDK?

I saw that exist secrets in Resources with a edit method, I have tried using but I dont know what permission I have to set to analysis works.

Can you help me?

Hi,

Currently, the SDK does not support permissions in Access Management for the specified methods. However, I will consult with our backend team to explore the possibility of enabling this type of access for manipulating secret variables.

In the meantime, you can use a temporary solution by instantiating the Resources class with your profile token. This approach should allow you to work with secret variables effectively. Below is an example of how you can implement this:

const { Analysis, Resources } = require(“@tago-io/sdk”);

// The function myAnalysis will run when you execute your analysis

async function myAnalysis(context, scope) {

const resources = new Resources({ token: “YOUR-PROFILE-TOKEN”});

await resources.secrets.list().then(console.info).catch(console.error);

}

Analysis.use(myAnalysis);

Thanks for the response.

I will use this workaround and wait for the enable in access management.

Adding more information to the case, I want to save a API token but I have to periodically refresh this token.

This is why I want to edit a secret.

You can create a token that never expires. Please refer to the following documentation for detailed guidance:

Account Token Documentation

No, the token is for access a external API, this API dont have a token that never expires.