The Dart SDK is currently in experimental status. If you would like to provide feedback, please reach out to us with your suggestions and comments on our Discord.
Dart - secret.version.access()
Retrieves the value from a version of a secret.
import 'package:nitric_sdk/nitric.dart';
final keyRef = Nitric.secret("apiKey").allow([
SecretPermission.access,
]);
final keyValue = await keyRef.latest().access();
Examples
Access the latest version of a secret
import 'package:nitric_sdk/nitric.dart';
final keyRef = Nitric.secret("apiKey").allow([
SecretPermission.access,
]);
final keyValue = await keyRef.latest().access();
Access a specific version of a secret
import 'package:nitric_sdk/nitric.dart';
final keyRef = Nitric.secret("apiKey").allow([
SecretPermission.access,
]);
final keyValue = await keyRef.version("the-version-id").access();