gatsby-source-eventbrite-full
v1.0.2
Published
Gatsby plugin to load Eventbrite Events with full HTML description
Downloads
6
Readme
gatsby-source-eventbrite-full
Clone of https://github.com/kwelch/gatsby-plugin-source-eventbrite with full HTML description.
A Gatsby plugin to asynchronously load events from the Eventbrite List Events By Organization.
Note: this will only load 50 events, this is to avoid thrashing the servers and eagerly loading.
Installation
With npm:
npm install --save gatsby-source-eventbrite-full
Or with Yarn:
yarn add gatsby-source-eventbrite-full
Usage
In your gatsby-config.js
file, load in the plugin along with the parameters of which events to load:
module.exports = {
plugins: [
{
resolve: 'gatsby-source-eventbrite-full',
options: {
// You will need to generate an Eventbrite Access token
// https://www.eventbrite.com/myaccount/apps/
token: 'ASDF1234',
// organization to load events for
organizationsId: '0987LKJH',
// This option will pass query param directly to the event search API
// https://www.eventbrite.com/platform/api#/reference/event-search/list/search-events
query: {
expand: ['venue'],
},
},
},
],
};
Keeping Dynamic Content
Since gatsby plugins are used to create static content, it will not load new events until the next deployment.
As a workaround you can use webhooks. You will need a webhook on the Eventbrite side to trigger a webhook to fire a new build.
Here are the steps for leveraging webhooks to keep fresh content when hosting with Netlify.
First, create Netlify a build hook url, see instructions here. From this you will have a url like this, https://api.netlify.com/build_hooks/XXXXXXXXXXXXXXX
, save it for the next step.
Next, create an Eventbrite Webhook to trigger the build when events are created or changed. Documentation on Eventbrite Webhooks can be found here.
Recommended Eventbrite Webhook actions:
event.created
event.published
event.unpublished
event.updated
organizer.updated
venue.updated
Then, use the Netlify build hook url as the "Payload URI".
Lastly, you can use the test button on the Eventbrite Webhook page to verify that the build was properly triggered.