# Using api from custom component

**URL:** https://meta.discourse.org/t/using-api-from-custom-component/304641
**Category:** Development
**Tags:** plugin-api
**Created:** [April 19, 2024, 4:39pm UTC](https://meta.discourse.org/t/using-api-from-custom-component/304641 "2024-04-19T16:39:33Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 19, 2024, 4:52pm UTC](https://meta.discourse.org/t/using-api-from-custom-component/304641/2 "2024-04-19T16:52:07Z")

</div>

Hello Garrett!

If you put this code in your theme to theme component `Head` tab,

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/0/b/e0bdbee83fd5c10da9d1983c6bb183d39459fa52.png)

You should be able to see the output in the browser’s _console_ (there is no HTML being displayed here):

![image](https://global.discourse-cdn.com/meta/original/4X/f/4/a/f4aba1939dccc54de802aff0463e029206c26c78.png)

Useful guide to learn about Theme component (also #Customization > Theme component tag) 👍

> [@Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648):
>
> Discourse Themes and Theme Components can be used to customize the look, feel and functionality of Discourse’s frontend. This section of the developer guides aims to provide all the reference materials you need to develop simple themes for a single site, right up to complex open-source theme components. This introduction aims to provide a map of all the tools and APIs for theme development. If you prefer a step-by-step tutorial for theme development, jump straight to: Themes vs. Theme Compon…

---

_[View the full topic](https://meta.discourse.org/t/using-api-from-custom-component/304641)._
