Code Monkey home page Code Monkey logo

gatsby-source-mautic's Introduction

Mautic form plugins

This plugins fetches forms from Mautic.

Setup

There are two options available to authenticate your app: - Basic Authentication (recommended for most cases), - Oauth2 (although I coudn't come up with a scenario, I added it just in case)

for basic authentication all you need to do is to provide following option in your gatsby-config.js:

{
    resolve: 'gatsby-source-mautic',
    options: {
        baseUrl: [URL of your mautic installation],
        auth: 'basic', [optional]
        publicKey: [your username],
        secretKey: [your password]
    }
}

sample config for oauth2:

{
    resolve: 'gatsby-source-mautic',
    options: {
        baseUrl: [URL of your mautic installation],
        auth: 'oauth2', [required]
        publicKey: [Fetch this from Mautic's API authentication],
        secretKey: [same as above],
        state: [some random number],
        redirectUri: [this should match with the one you provided to mautic]
    }
}

note that you need extra setup in your server config, if you want to authenticating your app on your server. You can, however, authenticate your app on your local machine and move token.json to your server.

GraphQL Output

The plugin fetches all form properties from Mautic API (see Mautic Developer Documentation). You can see a sample Query below. Note that to get a form field, you need to use formFields. Other than this, all property keys are identical to those in Mautic documentation.

{
  allMauticForm {
    edges {
      node {
        id
        actions {
          id
          properties {
            subject
          }
        }
        formFields {
          id
          type
          leadField
        }
      }
    }
  }
}

gatsby-source-mautic's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gatsby-source-mautic's Issues

Doesn't generate any nodes

I got the following error:

warning The gatsby-source-mautic plugin has generated no Gatsby nodes. Do you need it?

I belive my config is correct:

{
    resolve: 'gatsby-source-mautic',
    options: {
        baseUrl: 'http://go.mydomain.com',
        auth: 'basic',
        publicKey: 'myusernameishere',
        secretKey: 'mypassword_is_here'
    }
}

Can you please have a look?

ReferenceError: regeneratorRuntime is not defined

Hi,

I installed your plugin but I get the following error.

ReferenceError: regeneratorRuntime is not defined
  
  - auth.js:51 
    [ahrin_de]/[gatsby-source-mautic]/auth.js:51:46
  
  - auth.js:115 Object.<anonymous>
    [ahrin_de]/[gatsby-source-mautic]/auth.js:115:2
  
  - v8-compile-cache.js:178 Module._compile
    [ahrin_de]/[v8-compile-cache]/v8-compile-cache.js:178:30
  
  - loader.js:827 Object.Module._extensions..js
    internal/modules/cjs/loader.js:827:10
  
  - loader.js:685 Module.load
    internal/modules/cjs/loader.js:685:32
  
  - loader.js:620 Function.Module._load
    internal/modules/cjs/loader.js:620:12
  
  - loader.js:723 Module.require
    internal/modules/cjs/loader.js:723:19
  
  - v8-compile-cache.js:159 require
    [ahrin_de]/[v8-compile-cache]/v8-compile-cache.js:159:20
  
  - gatsby-node.js:5 Object.<anonymous>
    [ahrin_de]/[gatsby-source-mautic]/gatsby-node.js:5:13
  
  - v8-compile-cache.js:178 Module._compile
    [ahrin_de]/[v8-compile-cache]/v8-compile-cache.js:178:30
  
  - loader.js:827 Object.Module._extensions..js
    internal/modules/cjs/loader.js:827:10
  
  - loader.js:685 Module.load
    internal/modules/cjs/loader.js:685:32
  
  - loader.js:620 Function.Module._load
    internal/modules/cjs/loader.js:620:12
  
  - loader.js:723 Module.require
    internal/modules/cjs/loader.js:723:19
  
  - v8-compile-cache.js:159 require
    [ahrin_de]/[v8-compile-cache]/v8-compile-cache.js:159:20
  
  - api-runner-node.js:90 runAPI
    [ahrin_de]/[gatsby]/dist/utils/api-runner-node.js:90:22

Do you know what's going on?

I found the following StackOverflow question:

https://stackoverflow.com/questions/33527653/babel-6-regeneratorruntime-is-not-defined

Which makes me think there's is something missing in the list of depencies.

Best regards,
Daniel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.