# How to use discourse api in react native?

**URL:** https://meta.discourse.org/t/how-to-use-discourse-api-in-react-native/349356
**Category:** Support
**Tags:** rest-api
**Created:** [January 28, 2025, 11:42am UTC](https://meta.discourse.org/t/how-to-use-discourse-api-in-react-native/349356 "2025-01-28T11:42:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tarun\_Sharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarun_sharma/32/483195_2.png) [@Tarun\_Sharma](https://meta.discourse.org/u/Tarun_Sharma)
#### Post date: [January 28, 2025, 11:42am UTC](https://meta.discourse.org/t/how-to-use-discourse-api-in-react-native/349356/1 "2025-01-28T11:42:49Z")

</div>

I want to use discourse api to create community forum feature for my app.  
Now I am confused what should be the normal user flow for discourse means first we need to use the createUser api or what?

---

<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: [January 28, 2025, 4:54pm UTC](https://meta.discourse.org/t/how-to-use-discourse-api-in-react-native/349356/2 "2025-01-28T16:54:22Z")

</div>

You could take a look at [lexicon](https://www.lexicon.is/). It’s based on React Native and has excellent [documentation](https://docs.lexicon.is/version-2.2.0/), including the structure and architecture.

> [@Lexicon: a customizable native mobile app for your Discourse site](https://meta.discourse.org/t/lexicon-a-customizable-native-mobile-app-for-your-discourse-site/201085):
>
> Hey everyone, I wanted to quickly drop in here and mention that I’ve just open-sourced a project called [Lexicon](https://lexicon.is) with some colleagues of mine. It’s a pre-built, customizable native mobile app built on top of the Discourse API. We built it to help quickly integrate discussion and messaging features into other native mobile projects. This project was really enjoyable to build, primarily due to all of the hard work done in advance by the Discourse core team and community over the years. Screensh…

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

---

<div class="post-metadata">

### Author: ![Lexicon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lexicon/32/347938_2.png) [@Lexicon](https://meta.discourse.org/u/Lexicon)
#### Post date: [January 28, 2025, 5:29pm UTC](https://meta.discourse.org/t/how-to-use-discourse-api-in-react-native/349356/3 "2025-01-28T17:29:58Z")

</div>

Thanks for the mention. We are actually getting ready to release version 3 of Lexicon with some changes that are relevant to this topic.

Up until now Lexicon was relying on the `_t` cookie auth tokens for authenticating users to the target Discourse site. In version 3 we are switching to the officially supported approach with User API keys.

@Tarun_Sharma if you’re looking to do it yourself, we’d recommend following that approach, which is outlined here: [User API keys specification](https://meta.discourse.org/t/user-api-keys-specification/48536).

Also, Lexicon is open-source, so feel free to clone / fork the project and adapt it to your needs.

Best of luck!
