Skip to content

Commit 5dc0b5a

Browse files
omonksidharthachatterjee
authored andcommitted
docs(gatsby-plugin-guess-js): Document JWT (#15969)
1 parent 94a2c44 commit 5dc0b5a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/gatsby-plugin-guess-js/README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ module.exports = {
3636
options: {
3737
// Find the view id in the GA admin in a section labeled "views"
3838
GAViewID: `VIEW_ID`,
39+
// Add JWT token to perform authentication on deployment builds
40+
jwt: GA_JWT
3941
minimumThreshold: 0.03,
4042
// The "period" for fetching analytic data.
4143
period: {
@@ -50,7 +52,7 @@ module.exports = {
5052

5153
## Integrating with CI
5254

53-
Integrating this plugin within a CI pipeline may cause errors because the plugin will prompt the user/machine to log into the Google Analytics account - you need to send a jwt to authenticate properly
55+
Integrating this plugin within a CI pipeline may cause errors because the plugin will prompt the user/machine to log into the Google Analytics account. To get around this you'll need to generate a JWT for your GA account to pass to the plugin, this will enable the plugin to work in prod without any human interaction to authenticate permissions
5456

5557
```javascript
5658
// In your gatsby-config.js
@@ -77,3 +79,7 @@ module.exports = {
7779
],
7880
}
7981
```
82+
83+
### How to get a JWT token?
84+
85+
[Here](https://2ality.com/2015/10/google-analytics-api.html)

0 commit comments

Comments
 (0)