# Is a theme component or plugin best for external API calls?

**URL:** https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145
**Category:** Development
**Created:** [April 30, 2025, 12:38pm UTC](https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145 "2025-04-30T12:38:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![noahl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/noahl/32/552343_2.png) [@noahl](https://meta.discourse.org/u/noahl)
#### Post date: [April 30, 2025, 12:38pm UTC](https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145/1 "2025-04-30T12:38:28Z")

</div>

We have a certification program and want to allow users to join the certified group after confirming their certification ID.

The current idea:

- Have a button in a plugin outlet
- On click, open a modal for them to input their certification ID
- Send the ID to the API, and display a message according to the result
- Add them to the group if they’re verified

I want to understand if this is best suited as a Plugin or a Theme component since it’s dealing with API calls

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 30, 2025, 12:46pm UTC](https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145/2 "2025-04-30T12:46:50Z")

</div>

This is the full monty:

> [@Verifiable Credentials Plugin](https://meta.discourse.org/t/verifiable-credentials-plugin/220208):
>
> Summary: Use [Verifiable Credentials](https://www.w3.org/TR/vc-data-model/) to grant access to groups and badges in Discourse. link GitHub: https://github.com/coopcreds/discourse-verifiable-credentials arrow_right Install: Follow the [plugin installation guide](https://meta.discourse.org/t/install-a-plugin/19157). Demo You can try this plugin out your self by following the steps in the link below. You’ll be issued a test “Cooperative Credential” which you can then use to gain access to a group and be granted a badge on the cooperative credentials Discourse instance. Note that the…

But depends if your certification programme grants verifiable credentials …

---

<div class="post-metadata">

### Author: ![noahl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/noahl/32/552343_2.png) [@noahl](https://meta.discourse.org/u/noahl)
#### Post date: [April 30, 2025, 12:51pm UTC](https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145/3 "2025-04-30T12:51:05Z")

</div>

I think this might be a little different 🤔 Our certification is “someone finished a course and where given a certification with an ID”.

It’s an in house system, rather than an exisiting platform if that makes any difference. Currently, it takes 2 pieces of info (the users email, and the ID) and will return the certifications they have completed

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [April 30, 2025, 12:53pm UTC](https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145/4 "2025-04-30T12:53:27Z")

</div>

You might get away with a User Field which are exposed on the API.

If not, you’ll need a plugin.

But you’ll need to work out who can see what.

If this is confidential to the User or it’s ok for others to see it etc.

See:

> [@Private custom user fields...?](https://meta.discourse.org/t/private-custom-user-fields/232136):
>
> [The FAQ](https://meta.discourse.org/t/how-to-create-and-configure-custom-user-fields/113192) isn’t crystal clear about this, so I want to get confirmation. If I have a custom user field that is neither: Show[n] on public profile Show[n] on user card Then it’s effectively private, visible only to the user, admins & moderators?

---

<div class="post-metadata">

### Author: ![noahl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/noahl/32/552343_2.png) [@noahl](https://meta.discourse.org/u/noahl)
#### Post date: [April 30, 2025, 1:04pm UTC](https://meta.discourse.org/t/is-a-theme-component-or-plugin-best-for-external-api-calls/364145/5 "2025-04-30T13:04:43Z")

</div>

Amazing!

So thinking out aloud here:

- User field that is only visible to the user themselves (plus Admins etc)
- Webhook when “user is updated” should contain contain the ID
- Send the data to a “middle service” that can check the certification API, and then call the add to group Discourse API

Sounds like the most straight forward approach, rather than a plugin
