1.0.8 • Published 6 years ago

gatsby-source-asknicely v1.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

gatsby-source-asknicely

Loads testimonials from AskNicely into Gatsby.js

Installation

npm install gatsby-source-asknicely

Usage

To use this source you need to supply an AskNicely API key and your AskNicely subdomain. You can create an API key by logging into AskNicely and going to Cog > API. You can see your subdomain by logging into your AskNicely backend and checking the URL, e.g. mycompany.asknicely.com.

Next, edit gatsby-config.js to use the plugin:

{
    ...
    plugins: [
    ...
    {
      resolve: 'gatsby-source-asknicely',
      options: {
        subdomain: 'mycompany',
        apiKey: 'abc-123',
        // optional
        queryParams: {
            // See API docs
            // NB: camelCased!
        }
      },
    },
  ]
}

By default, gatsby-source-asknicely will only retrieve testimonials that are published. To change this behavior, you can also supply an optional queryParams parameter inside of options. Possible query parameters are detailed in AskNicely's API Documentation, but camelCased! (ie, pagesize = pageSize, since_time = sinceTime)

Querying

You can query the nodes created by the plugin as follows:

{
    allAskNicelyTestimonial {
        edges {
            node {
                ...
            }
        }
    }
}

Thanks

Based on @tumblbug's gatsby-source-workable

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago