The official Gatsby plugin for integrating JamComments into your Gatsby application.
Setup
- Create a JamComments account.
- Create a site and generate an API key.
- Install this plugin:
npm install gatsby-plugin-jam-comments
. - Configure the plugin by adding the following to your
gatsby-node.js
:
resolve: 'gatsby-plugin-jam-comments',
options: {
api_key: "YOUR-API-KEY",
domain: "your-domain.me"
}
},
Usage
To include a comment form and existing comments on your blog posts, you'll need to place the following component on your page component(s), along with the required path
and pageContext
props:
<JamComments path={props.path} pageContext={props.pageContext} />
Querying for Data
{
allJamComment(limit: 10) {
edges {
node {
content
name
path
id
}
}
}
}