How to access secrets in Livebook code? #1532
-
I thought I knew Elixir well enough (😅) but am now realizing that all-caps variables in Elixir are not what I expected them to be: > IO.inspect DOMAIN
DOMAIN That makes it seem like an Atom, to me. I'm not entirely sure how else I would access secrets in Livebook: Are they not surfaced in the code as they are represented in the sidebar as all-caps? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @nicksergeant, secrets are accessible as env vars (similarly to env vars defined in the global settings). The only difference is that they have |
Beta Was this translation helpful? Give feedback.
Hey @nicksergeant, secrets are accessible as env vars (similarly to env vars defined in the global settings). The only difference is that they have
LB_
prefix. So in your case you can doSystem.fetch_env!("LB_BEARER_TOKEN")
:)