Skip to content
Frontend module to Jamments' API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
src
.editorconfig
.eslintrc
.gitignore
LICENCE.md
README.md
package-lock.json
package.json
rollup.config.js

README.md

Jamments front

This library is to be used with Jamments comment API.

Jamments is a self hosted commenting API that puts you in control. It's a dead simple REST API that seamlessly integrates with your already existing JAMstack.

This is the frontend API library for Jamments' API. Its aim is to ease Jamments integration within your code. You should go to the documentation for more details.

Also note that this library uses the Fetch API and that it might not be available in older browsers. If you're willing to support older browsers, you can easily polyfill it.

Install with npm or yarn

npm install --save jamments-front

And then just import it as any ES module.

import Jamments from 'jamments-front';

Usage

Here's how you post a new comment

jamments.postComment(slug, comment, name, email, parentId)
.then(() => {
    // comment successfully submitted to the api
})
.catch((err) => {
    // Houston, we had a problem
});
You can’t perform that action at this time.