JSPM

@factly/gatsby-source-dega

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 58
    • Score
      100M100P100Q111134F
    • License MIT

    Package Exports

    • @factly/gatsby-source-dega
    • @factly/gatsby-source-dega/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@factly/gatsby-source-dega) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @factly/gatsby-source-dega

    Source from [DegaCMS](https://dega.factly.in) API in Gatsby.

    Install

    npm install --save @factly/gatsby-source-dega

    How to use

    Prerequisites

    First, you need a way to pass environment variables to the build process, so secrets and other secured data aren't committed to source control. I recommend using [dotenv][dotenv] which will then expose environment variables. [Read more about dotenv and using environment variables here][envvars]. Then you can use these environment variables and configure your plugin.

    You'll need an API Key and Space Id from dega

    Save both to your environment variable file

    It should look something like this:

    API_KEY=your-api-key-here
    SPACE_ID=you-space-id-here

    gatsby-config

    The plugin sets some defaults for the endpoints and options. Hence you can use it only with the two mandatory entries apiKey and spaceId.

    module.exports = {
      plugins: [
        {
          resolve: '@factly/gatsby-source-dega',
          options: {
            // apiKey and spaceId are mandatory
            apiKey: process.env.API_KEY,
            spaceId: process.env.SPACE_ID,
          },
        },
      ],
    }