How to Add New Secret Type?
A secret type should be added for each node that requires a set of secret fields. A type of the secret helps to distinct secrets with the same structure which are not interchangeable. For example, despite both OpenAI and Anthropic API keys simply are strings, you can't use one instead of another.
New Secret Type can be added in two steps:
- Add the Zod schema of the secret value. It is always an object that consists of several fields. To do this locate object
secretTypeSchemasin the filepackages/chaingraph-types/src/port/base/secret.ts, and assign the desired schema to a new key in this object. Object key will become an identifier for this type of secret. - In the same file locate object
secretTypeMetadata, and assign the necessary metadata (which is icon URL, secret label, and a label for each field of the secret) to the same key as in the previous step.