# Plugin Gatsby pour utiliser Discourse en tant que CMS headless

**URL:** https://meta.discourse.org/t/gatsby-plugin-to-use-discourse-as-headless-cms/150532
**Category:** Development
**Created:** [Mai 5, 2020, 10:07 UTC](https://meta.discourse.org/t/gatsby-plugin-to-use-discourse-as-headless-cms/150532 "2020-05-05T22:07:31Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![kristoferlund](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kristoferlund/32/140560_2.png) [@kristoferlund](https://meta.discourse.org/u/kristoferlund)
#### Post date: [Mai 6, 2020, 5:48 UTC](https://meta.discourse.org/t/gatsby-plugin-to-use-discourse-as-headless-cms/150532/3 "2020-05-06T05:48:37Z")

</div>

Pas actuellement, mais c’est une bonne idée, ce ne serait pas difficile à ajouter. L’accès au contenu privé nécessite une authentification. Un nom d’utilisateur et une clé API pourraient être ajoutés à la configuration de Gatsby.

> [@How to allow user-agent access to private discourse?](https://meta.discourse.org/t/how-to-allow-user-agent-access-to-private-discourse/35537/8):
>
> Yes we do! To crawl the topics via Discourse API just provide your API key and username, and the requests made will be authenticated as regular user. For example: To achieve the same via cURL request, pass api\_key and api\_username as param. For example: curl -X GET -d api\_key="API\_KEY" -d api\_username="ADMIN\_USERNAME" http://discourse.example.com/latest.json ``` Both of the above examples will fetch all the latest topics (even for private Discourse instance). @Joey\_Tuan for more detaile…

---

_[View the full topic](https://meta.discourse.org/t/gatsby-plugin-to-use-discourse-as-headless-cms/150532)._
