How to access secrets in Livebook code? #1532
Answered
by
jonatanklosko
nicksergeant
asked this question in
Q&A
-
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.
Answered by
jonatanklosko
Nov 16, 2022
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.
1 reply
Answer selected by
hugobarauna
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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")
:)