# Embed variables in footer

**URL:** https://meta.discourse.org/t/embed-variables-in-footer/147801
**Category:** Support
**Created:** [April 13, 2020, 1:04pm UTC](https://meta.discourse.org/t/embed-variables-in-footer/147801 "2020-04-13T13:04:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pnoeric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pnoeric/32/177144_2.png) [@pnoeric](https://meta.discourse.org/u/pnoeric)
#### Post date: [April 13, 2020, 1:04pm UTC](https://meta.discourse.org/t/embed-variables-in-footer/147801/1 "2020-04-13T13:04:37Z")

</div>

Hi, I’d like to embed the SSO `external_id` in some custom Javascript I’m pasting into my theme footer (using the ‘Custom HTML/CSS’ button)… is there a way to access the `external_id` from that template? i.e. something sorta like:

```plaintext
<script>
   var id = {{ sso.external_id }};
</script>

```

If I can’t embed `external_id`, I would love to be able to embed the `username` and `email`.

---

<div class="post-metadata">

### Author: ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)
#### Post date: [April 13, 2020, 9:22pm UTC](https://meta.discourse.org/t/embed-variables-in-footer/147801/2 "2020-04-13T21:22:24Z")

</div>

Hi,  
you could map `sso` field to custom user field and use it like this

```plaintext
const user = api.getCurrentUser()
console.log(user.custom_fields.external_id)

```

How to map sso field to custom user field, check here: [Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045)

You need to make that custom field public in the settings in order to access it in the theme.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 13, 2020, 9:22pm UTC](https://meta.discourse.org/t/embed-variables-in-footer/147801/3 "2020-05-13T21:22:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
