churchsuite-events-gatsby-plugin

1.1.2 • Public • Published

churchsuite-gatsby-plugin

Gatsby source plugin for sourcing data into your Gatsby application from churchsuite api

npm


Install

# using npm
npm install churchsuite-gatsby-plugin

# using yarn
yarn add churchsuite-gatsby-plugin

Add to project

// In gatsby-config.js
plugins: [
		{
			resolve: 'churchsuite-events-gatsby-plugin',
			options: {
        // related to calendar embed that runs on build
        domain: `YOUR_CHURCHSUITE_DOMAIN` // referred to as {your_account_id} in CS docs.
        date_start: `yyy-mm-dd`,
				date_end: `yyy-mm-dd`,
				featured: `0|1`,
				category_ids: `1,2`, // comma seperated list
				site_ids: '', // comma seperated list
				embed_signup: `boolean`,
				public_signup: `boolean`,
        // used by event sign up
        account: 'YOUR_CHURCHSUITE_X-ACCOUNT_HEADER_VALUE',
        application: 'YOUR_CHURCHSUITE_X-APPLICATION_HEADER_VALUE',
        authkey: 'YOUR_CHURCHSUITE_X-AUTH_HEADER_VALUE'
        },
		},
	]

All the options listed here (besides domain) are passed through to churchsuite-api so you can refer to CS docs for full list of accepted values.

Imported data

Calendar JSON feed

Calendar events imported from churchsuite-api calendar embed

These can be accessed via gatsby Graphql using a query like

query allEvents {
  allEvent {
    nodes {
      id
      name
      datetime_start
      datetime_end
      identifier
      // etc
    }
    pageInfo {
      // paging information
    }
  }
}

A full list of available fields can be seen in the Gatsby graphql explorer.

Available methods

function signUp(eventId, data) {}

eventId - the string identifier of your event, retreieved from graphql allEvents query. data - an object container the data for the sign up, e.g

{
  first_name: 'Mark',
  last_name: 'Davies',
  mobile: '',
  email: 'mark.davies@gmail.com',
}

License

0BSD License

Dependents (0)

Package Sidebar

Install

npm i churchsuite-events-gatsby-plugin

Weekly Downloads

1

Version

1.1.2

License

0BSD

Unpacked Size

7.97 kB

Total Files

7

Last publish

Collaborators

  • nanorepublica
  • bradleyisfluent