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()
Returns a reference to a known version of a secret.
import 'package:nitric_sdk/nitric.dart';
final keyRef = Nitric.secret("encryptionKey").allow([
SecretPermission.access,
]);
final keyVersionRef = keyRef.version("the-version-id");
Parameters
- Name
version
- Required
- Required
- Type
- String
- Description
The version ID. This value is returned from secret.put().
Examples
Return a reference to a known secret version
import 'package:nitric_sdk/nitric.dart';
final keyRef = Nitric.secret("encryptionKey").allow([
SecretPermission.access,
]);
final keyVersionRef = keyRef.version("the-version-id");
Access the value of a known secret version
import 'package:nitric_sdk/nitric.dart';
final keyRef = Nitric.secret("encryptionKey").allow([
SecretPermission.access,
]);
final keyValue = await keyRef.version("the-version-id").access();