@pantheon-systems/decoupled-kit-health-check
v0.2.4
Published
Pantheon Decoupled Kit's Health Check
Downloads
2,713
Keywords
Readme
Pantheon Systems Health Check
What does it do?
The Decoupled Drupal health check will:
- Check for a BACKEND_URL and/or PANTHEON_CMS_ENDPOINT environment variable
- If both are set, use the BACKEND_URL for checks, otherwise use whatever is set. Throw an error if none are set.
- Fetch the language settings to determine subsequent calls.
- Fetch the decoupled router on an article based on 3. Throw an error if the decoupled router can not be reached.
- Fetch the decoupled footer menu. Throw an error if it can not be fetched.
- Use the set CLIENT_ID and CLIENT_SECRET to fetch an oauth token. Warnings are logged if these are not set.
- Check that the PREVIEW_SECRET is set
- Use the access_token if available to fetch preview content. Logs a warning if preview is not accessible.
The Decoupled WordPress health check will:
- check for a WPGRAPHQL_URL and/or PANTHEON_CMS_ENDPOINT environment variable
- If both are set, use the WPGRAPHQL_URL for checks, otherwise use whatever is set. Throw an error if none are set.
- Try to fetch the Example Menu, throw an error if it can not be reached.
- Use the set WP_APPLICATION_USERNAME and WP_APPLICATION_PASSWORD to fetch private posts. Warnings are logged if these are not set or are not valid.
- Check that the PREVIEW_SECRET is set.
- Use the credentials if available to fetch preview content. Logs a warning if preview is not accessible..
Usage
Next + Drupal
In the directory of your next-drupal
project:
npx @pantheon-systems/decoupled-kit-health-check drupal
Next or Gatsby + WordPress
In the directory of your next-wordpress
or gatsby-wordpress
project:
npx @pantheon-systems/decoupled-kit-health-check wordpress
Opt Out
To opt out of the health check without changing any configuration in the
package.json
, set the NO_DKHC
environment variable. If this variable is set
to anything, the health check will be skipped.