The documentation mentions
If nonces are requested for any directives, they will be available in the assigns map of the conn as _nonce — e.g., conn.assigns[:style_src_nonce] — and the nonce will be inserted into the CSP header.
Creating nonce-
plug PlugContentSecurityPolicy,
nonces_for: [:script_src],
directives: %{script_src : ~w('self')}
assigning nonce-
<<script nonce= "<%conn.assigns[:script_src_nonce]%>" >
//some inline scripts
</script>
I was able to generate nonce for script tag in the csp header but when inserting it into inline JS, I am getting 'Compile error - undefined function conn/0'