You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configuration for a [supported provider](#providers).
86
+
87
+
-`access` | optional
88
+
89
+
Accepts a function that takes in the req.user object to determine access to the API routes. **By default the routes are unprotected.**
90
+
91
+
Example to allow only authenticated users:
92
+
93
+
```ts
94
+
access: (user:any) =>Boolean(user);
95
+
```
96
+
97
+
-`navigation` | optional
98
+
99
+
Object of either `beforeNavLinks``afterNavLinks` which are arrays of [navigation widgets](#navigation).
100
+
101
+
-`dashboard` | optional
102
+
103
+
Object of either `beforeDashboard``afterDashboard` which are arrays of [dashboard widgets](#dashboard).
104
+
105
+
-`globals` | optional
106
+
107
+
Array of global configurations requiring a slug and an array of [page widgets](#page).
108
+
109
+
-`collections` | optional
110
+
111
+
Array of collection configurations requiring a slug and an array of [page widgets](#page).
112
+
113
+
## Widgets
114
+
115
+
A full list of supported widgets. Due to some time limitations or API constraints the selection may be limited.
116
+
117
+
### Navigation
118
+
119
+
Navigation widgets have no configuration.
120
+
121
+
#### Live visitors
122
+
123
+
**type**`live`
124
+
125
+
```ts
126
+
{
127
+
type: "live";
128
+
}
129
+
```
130
+
131
+
### Dashboard
132
+
133
+
Dashboard widgets have no configuration.
134
+
135
+
#### Views chart
136
+
137
+
**type**`viewsChart`
138
+
139
+
```ts
140
+
["viewsChart"];
141
+
```
142
+
143
+
#### Top pages
144
+
145
+
**type**`topPages`
146
+
147
+
```ts
148
+
["topPages"];
149
+
```
150
+
151
+
### Page
152
+
153
+
Page widgets have more configuration available with custom timeframes and metrics. These are usable on both globals and collections.
154
+
155
+
#### Page chart
156
+
157
+
-**type** | `chart` | required
158
+
159
+
-**label** | string or `hidden` | optional
160
+
Sets a custom label for the component in the frontend, defaults to a list of metrics and it's accompanied by the timeframe.
161
+
If `hidden` then the label is not displayed.
162
+
163
+
-**metrics** | metric[] | required
164
+
Array of metrics to fetch data for. See list of [available metrics](#metrics).
165
+
166
+
-**timeframe** | timeframe | optional
167
+
Defaults to `30d`. See list of [available timeframes](#timeframes).
168
+
169
+
-**idMatches** | function | required
170
+
A function that takes in the published document from the React hook `useDocument` and returns a string that matches the current page to a page in the analytics data.
Sets a custom label for the component in the frontend, defaults to a list of metrics and it's accompanied by the timeframe.
188
+
If `hidden` then the label is not displayed.
189
+
190
+
-**metrics** | metric[] | required
191
+
Array of metrics to fetch data for. See list of [available metrics](#metrics).
192
+
193
+
-**timeframe** | timeframe | optional
194
+
Defaults to `30d`. See list of [available timeframes](#timeframes).
195
+
196
+
-**idMatches** | function | required
197
+
A function that takes in the published document from the React hook `useDocument` and returns a string that matches the current page to a page in the analytics data.
0 commit comments