|
1 | 1 | # netlify-plugin-sitrep |
2 | | -A Netlify build plugin to display debug information in dev or staging environments |
| 2 | +[](https://badge.fury.io/js/%40quarva%2Fnetlify-plugin-sitrep) |
3 | 3 |
|
4 | | -# Install |
| 4 | +A Netlify build plugin that injects build and deploy information into the DOM for debugging. |
5 | 5 |
|
6 | | -Please install this plugin from the Netlify app. |
| 6 | + |
7 | 7 |
|
8 | | -Create an application token and store it as an environment variable called `BUILD_SITREP_TOKEN` |
| 8 | +## Usage |
9 | 9 |
|
10 | | -# Configuration |
| 10 | +### Set up your Netlify environment variables |
11 | 11 |
|
12 | | -The following `inputs` options are available. |
| 12 | +The plugin accesses Netlify's postprocessing snippet injection using the Netlify API, so we need to provide an access token. |
13 | 13 |
|
14 | | -name: `allow_prod` |
15 | | -description: If true, debug data will be injected in the production context. |
| 14 | +1. Sign in to Netlify and navigate to User Settings -> [Applications](https://app.netlify.com/user/applications) |
| 15 | +2. Generate a new personal access token |
| 16 | +3. Store that personal access token as an environment variable called `BUILD_SITREP_TOKEN` in the site(s) you want to use the plugin with. |
16 | 17 |
|
| 18 | +### Install |
| 19 | + |
| 20 | +``` |
| 21 | +npm install --save "@quarva/netlify-plugin-sitrep" |
| 22 | +``` |
| 23 | + |
| 24 | +### Add the plugin to `netlify.toml` |
| 25 | + |
| 26 | +```toml |
| 27 | +[[plugins]] |
| 28 | +package = "@quarva/netlify-plugin-sitrep" |
| 29 | +``` |
| 30 | + |
| 31 | +Note: The `[[plugins]]` line is required for each plugin, even if you have other |
| 32 | +plugins in your `netlify.toml` file already. |
| 33 | + |
| 34 | +### Configuration |
| 35 | + |
| 36 | +By default, the plugin won't inject any data in a production context. You can adjust that with the `allow_prod` input. |
| 37 | + |
| 38 | +```toml |
17 | 39 | [[plugins]] |
18 | | -package = "." |
| 40 | +package = "@quarva/netlify-plugin-sitrep" |
19 | 41 | [plugins.inputs] |
20 | | - "allow_prod" = "true" |
| 42 | + "allow_prod" = "false" |
| 43 | + # If true, the plugin will work in production. |
| 44 | +``` |
0 commit comments