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();
Last updated on Nov 4, 2024