import { Steps, Callout } from 'nextra/components'; import { YoutubePlayer } from '../../../components/player';
Using Dashlane CLI you can inject secrets into templated files. This is useful for example to inject secrets into configuration files and avoid storing secrets in your repository.
### Get your secret referenceFollow the guide in Read secrets references to learn how to get your secret reference.
It should look like this: dl://<secret_identifier>/<field>?<transformer>
In your template config file, use the secret reference as a placeholder for the value you want to inject.
The secret reference must be enclosed in double curly braces {{ }}
.
For instance, let's create a template config file for a fictive API:
api:
url: https://api.example.com
port: 443
access_token: '{{ dl://<secret_identifier>/<field> }}'
Use the dcli inject
command to inject secrets into your config file.
dcli inject --in config.yaml.template --out config.yaml
In output file, the secret reference is replaced by the plaintext secret value.
Make sure to delete the resolved config file if you no longer need it.