# Discourse implementation in create react app

**URL:** https://meta.discourse.org/t/discourse-implementation-in-create-react-app/265666
**Category:** Development
**Created:** [May 20, 2023, 7:13pm UTC](https://meta.discourse.org/t/discourse-implementation-in-create-react-app/265666 "2023-05-20T19:13:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![khemrajneupane](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/khemrajneupane/32/307858_2.png) [@khemrajneupane](https://meta.discourse.org/u/khemrajneupane)
#### Post date: [May 20, 2023, 7:13pm UTC](https://meta.discourse.org/t/discourse-implementation-in-create-react-app/265666/1 "2023-05-20T19:13:32Z")

</div>

I am a new user to Discourse. I am trying to implement Discourse commenting into my React app but looks very complex to me. Is there a simple public API call that I can make with axios of fetch? I want to start with this because I tried with my API keys and username but there is axios error:

````plaintext
    const fetchComments = async () => {
      try {
        const response = await axios(
          'https://discourse.mydomain.com/t/category/13.json',{
            headers: {
              'Api-Key': apiKey,
              'Api-Username': apiUsername
            }
          }
        )
.then(data=>datas.json())
.then(checkData=>console.log(checkData)
        console.log("discourse",response)
      } catch (error) {
        console.error('Error fetching comments:', error);
      }
    };```
````

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 20, 2023, 10:16pm UTC](https://meta.discourse.org/t/discourse-implementation-in-create-react-app/265666/2 "2023-05-20T22:16:50Z")

</div>

Maybe you want [Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963)?

---

<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: [May 20, 2023, 10:23pm UTC](https://meta.discourse.org/t/discourse-implementation-in-create-react-app/265666/3 "2023-05-20T22:23:19Z")

</div>

This is a React Native app that uses the Discourse API, might be of some help?

[https://github.com/lexiconhq/lexicon](https://github.com/lexiconhq/lexicon)
