Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization process #55

Closed
jpowell opened this issue Jul 13, 2018 · 5 comments
Closed

Initialization process #55

jpowell opened this issue Jul 13, 2018 · 5 comments
Labels
feedback Input for future developments / planning question Further information is requested

Comments

@jpowell
Copy link
Member

jpowell commented Jul 13, 2018

A block of this nature can go in an initializer or config if you're not using rails.

WCC::Contentful.configure do |config|
  # Required
  config.access_token = ENV['CONTENTFUL_ACCESS_TOKEN']
  config.space = ENV['CONTENTFUL_SPACE_ID']

  # Optional
  config.environment = ENV['CONTENTFUL_ENVIRONMENT']
  config.management_token = ENV['CONTENTFUL_MANAGEMENT_TOKEN']

  # config.default_locale = # Set default locale, if left blank this is 'en-US'
  # config.content_delivery = :eager_sync
  # config.sync_store = # :memory, :postgres, or a custom implementation

  # config.webhook_username = 'test'
  # config.webhook_password = 'supersecret'

  config.webhook_jobs << AlgoliaSyncJob
end

# Download content types, build models, and sync content
WCC::Contentful.init!

# Validate that models conform to a defined specification
# WCC::Contentful.validate_models! unless defined?(Rails) && Rails.env.development?

/cc @reidcooper - would love any feedback you have

@reidcooper
Copy link
Contributor

@jpowell I would suggest at least adding the configuration options to the README and/or to the generator. For example, I didn't even know I could use "content_delivery" without diving into the code.

@jpowell
Copy link
Member Author

jpowell commented Jul 13, 2018

Sweet! We've been using this internally, and are actively developing conventions around how we use contentful as we spin up multiple apps. Since it's been internal, the docs are coming along more slowly. We do have some docs at www.rubydoc.info/github/watermarkchurch/wcc-contentful

The reasons for building this was our needs around using contentful in production (cache invalidation, webhook management, etc), ease of use and extensibility from an individual app implementation standpoint.

I'm in the contentful slack organization if you'd like to shorten the feedback loop.

@jpowell jpowell added the feedback Input for future developments / planning label Jul 13, 2018
@reidcooper
Copy link
Contributor

@jpowell Do you have a quick link for the contentful slack? It would be better to chit chat that way.

@jpowell
Copy link
Member Author

jpowell commented Jul 13, 2018

https://www.contentful.com/slack/

@gburgett
Copy link
Member

Hi @reidcooper ! I'm also happy to answer any of your questions. Ping me on the contentful slack if you need anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback Input for future developments / planning question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants