However, validator can also be used as a standalone package to verify the correctness of the configuration files without deploying the Airnode. The recommended way is to use the validator CLI, but for advanced use cases you can use the validator SDK.
The validator package contains an API that can be used to validate Airnode configuration files programatically.
The following functions can be used:
parseConfigWithSecrets(config, secrets) - Interpolates secrets into config and validates the interpolated configuration. Expects both config and secrets to be JSON objects.
parseConfig(config) - Validates the config. Expects the config to be a JSON object.
parseSecrets(secrets) - Validates the secrets. Expects the secrets to be a JSON object.
parseReceipt(receipt) - Validates the receipt. Expects the receipt to be a JSON object.
unsafeParseConfigWithSecrets(config, secrets) - Interpolates secrets into config but does not perform any validation afterwards. Use this function only when you can guarantee that the configuration is valid.
Validator has also full TypeScript support. All of these functions return a typed object.