Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erickzhao/gatsby-source-itchio
🕹 itch.io server-side API as a data source for GatsbyJS
https://github.com/erickzhao/gatsby-source-itchio
gamedev gatsby gatsby-source-plugin itchio javascript
Last synced: about 2 months ago
JSON representation
🕹 itch.io server-side API as a data source for GatsbyJS
- Host: GitHub
- URL: https://github.com/erickzhao/gatsby-source-itchio
- Owner: erickzhao
- License: mit
- Created: 2019-03-04T14:13:50.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T18:40:19.000Z (almost 2 years ago)
- Last Synced: 2024-10-15T12:56:27.434Z (2 months ago)
- Topics: gamedev, gatsby, gatsby-source-plugin, itchio, javascript
- Language: JavaScript
- Homepage:
- Size: 221 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gatsby-source-itchio
A source plugin for [GatsbyJS](https://www.gatsbyjs.org/) to query game information from the [itch.io](https://itch.io/) serverside API.
## Install
```
# npm
npm install --save gatsby-source-itchio#yarn
yarn add gatsby-source-itchio
```Then add the following to your `gatsby-config.js`:
```javascript
module.exports = {
/* ... */
plugins: [
/* ... */
{
resolve: "gatsby-source-itchio",
options: {
key: // YOUR_API_KEY
}
}
]
};
```To use this plugin, you'll need a web API key for your itch.io account (get one [here](https://itch.io/user/settings/api-keys)).
## How to query
See [API documentation](https://itch.io/docs/api/serverside#reference/profilegames-httpsitchioapi1keymy-games) for the endpoint here.
```javascript
const gameQuery = `
query GameQuery {
allItchioGame(limit: 10) {
edges {
node {
user {
display_name,
id,
url,
cover_url,
username
},
id,
url,
created_at,
title,
classification,
type,
short_text,
published,
published_at,
views_count,
can_be_bought,
min_price,
purchases_count,
p_osx,
p_android,
p_linux,
p_windows,
in_press_system,
}
}
}
}
`;
```