Secret Helpers for Wix Secrets Manager APIs
This library provides a convenient helper for securely retrieving secrets from Wix Secrets Manager, with built-in memory caching and optional JSON parsing.
Usage
Basic Example: Retrieve a Secret as a String
import { getSecretValue } from '@exweiv/wix-secret-helpers';
const weatherAPIKey = await getSecretValue("WeatherAPIKey");
const client = new WeatherClient(weatherAPIKey);
Advanced Example: Retrieve and Parse a JSON Secret
import { getSecretValue } from '@exweiv/wix-secret-helpers';
const twitterAPIConfig = (await getSecretValue("TwitterJSON", true));
const client = new TwitterAPI(twitterAPIConfig);
Features:
- Memory caching (enabled by default, but can be disabled)
- Optional JSON parsing for secrets stored as JSON
Kolay Gelsin 💜
