1"use strict";(self.rspackChunkwebsite=self.rspackChunkwebsite||[]).push([[15162],{13809(e,n,r){r.r(n),r.d(n,{assets:()=>d,contentTitle:()=>u,default:()=>f,frontMatter:()=>c,metadata:()=>t,toc:()=>h});var t=JSON.parse('{"id":"api/plugins/plugin-vercel-analytics","title":"\u{1F4E6} plugin-vercel-analytics","description":"Vercel Analytics provides comprehensive insights into your website\'s visitors, tracking top pages, referrers, and demographics like location, operating systems, and browser info.","source":"@site/versioned_docs/version-3.7.0/api/plugins/plugin-vercel-analytics.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-vercel-analytics","permalink":"/docs/3.7.0/api/plugins/@docusaurus/plugin-vercel-analytics","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-vercel-analytics.mdx","tags":[],"version":"3.7.0","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1772830092000,"sidebarPosition":11,"frontMatter":{"sidebar_position":11,"slug":"/api/plugins/@docusaurus/plugin-vercel-analytics"},"sidebar":"api","previous":{"title":"\u{1F4E6} plugin-sitemap","permalink":"/docs/3.7.0/api/plugins/@docusaurus/plugin-sitemap"},"next":{"title":"Themes overview","permalink":"/docs/3.7.0/api/themes"}}'),a=r(62540),i=r(43023),s=r(65855),l=r(49714),o=r(65665);let c={sidebar_position:11,slug:"/api/plugins/@docusaurus/plugin-vercel-analytics"},u="\u{1F4E6} plugin-vercel-analytics",d={},h=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Example configuration",id:"ex-config",level:3}];function p(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"-plugin-vercel-analytics",children:"\u{1F4E6} plugin-vercel-analytics"})}),"\n","\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.a,{href:"https://vercel.com/docs/analytics",children:"Vercel Analytics"})," provides comprehensive insights into your website's visitors, tracking top pages, referrers, and demographics like location, operating systems, and browser info."]}),"\n",(0,a.jsx)(n.admonition,{title:"production only",type:"warning",children:(0,a.jsxs)(n.p,{children:["This plugin is always inactive in development and ",(0,a.jsx)(n.strong,{children:"only active in production"})," (",(0,a.jsx)(n.code,{children:"docusaurus build"}),") to avoid polluting the analytics statistics."]})}),"\n",(0,a.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,a.jsxs)(s.A,{groupId:"npm2yarn",children:[(0,a.jsx)(l.A,{value:"npm",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-vercel-analytics\n"})})}),(0,a.jsx)(l.A,{value:"yarn",label:"Yarn",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-vercel-analytics\n"})})}),(0,a.jsx)(l.A,{value:"pnpm",label:"pnpm",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-vercel-analytics\n"})})}),(0,a.jsx)(l.A,{value:"bun",label:"Bun",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"bun add @docusaurus/plugin-vercel-analytics\n"})})})]}),"\n",(0,a.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,a.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,a.jsx)(o.A,{children:(0,a.jsxs)(n.table,{children:[(0,a.jsx)(n.thead,{children:(0,a.jsxs)(n.tr,{children:[(0,a.jsx)(n.th,{children:"Name"}),(0,a.jsx)(n.th,{children:"Type"}),(0,a.jsx)(n.th,{children:"Default"}),(0,a.jsx)(n.th,{children:"Description"})]})}),(0,a.jsxs)(n.tbody,{children:[(0,a.jsxs)(n.tr,{children:[(0,a.jsx)(n.td,{children:(0,a.jsx)(n.code,{children:"mode"})}),(0,a.jsx)(n.td,{children:(0,a.jsx)(n.code,{children:"string"})}),(0,a.jsx)(n.td,{children:(0,a.jsx)(n.code,{children:"'auto'"})}),(0,a.jsxs)(n.td,{children:["Override the automatic environment detection. Read the ",(0,a.jsx)(n.a,{href:"https://vercel.com/docs/analytics/package#mode",children:"official docs"})," for details."]})]}),(0,a.jsxs)(n.tr,{children:[(0,a.jsx)(n.td,{children:(0,a.jsx)(n.code,{children:"debug"})}),(0,a.jsx)(n.td,{children:(0,a.jsx)(n.code,{children:"boolean"})}),(0,a.jsx)(n.td,{children:(0,a.jsx)(n.code,{children:"undefined"})}),(0,a.jsxs)(n.td,{children:["Enable browser console logging of analytics events. Read the ",(0,a.jsx)(n.a,{href:"https://vercel.com/docs/analytics/package#debug",children:"official docs"})," for details."]})]})]})]})}),"\n",(0,a.jsx)(n.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,a.jsx)(n.p,{children:"You can configure this plugin through plugin options."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n plugins: [\n [\n 'vercel-analytics',\n {\n debug: true,\n mode: 'auto',\n },\n ],\n ],\n};\n"})})]})}function f(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(p,{...e})}):p(e)}}
1,49714(e,n,r){r.d(n,{A:()=>l});var t=r(62540);r(63696);var a=r(11750),i=r(25237);function s({children:e,className:n,hidden:r}){return(0,t.jsx)("div",{role:"tabpanel",className:(0,a.A)("tabItem_pnkT",n),hidden:r,children:e})}function l({children:e,className:n,value:r}){let{selectedValue:a,lazy:o}=(0,i.uc)(),c=r===a;return!c&&o?null:(0,t.jsx)(s,{className:n,hidden:!c,children:e})}},65855(e,n,r){r.d(n,{A:()=>h});var t=r(62540);r(63696);var a=r(11750),i=r(2445),s=r(25237),l=r(70662),o=r(73749);function c({className:e}){let{selectedValue:n,selectValue:r,tabValues:i,block:o}=(0,s.uc)(),u=[],{blockElementScrollPositionUntilNextRender:d}=(0,l.a_)(),h=e=>{let t=e.currentTarget,a=i[u.indexOf(t)].value;a!==n&&(d(t),r(a))},p=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let r=u.indexOf(e.currentTarget)+1;n=u[r]??u[0];break}case"ArrowLeft":{let r=u.indexOf(e.currentTarget)-1;n=u[r]??u[u.length-1]}}n?.focus()};return(0,t.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":o},e),children:i.map(({value:e,label:r,attributes:i})=>(0,t.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{u.push(e)},onKeyDown:p,onClick:h,...i,className:(0,a.A)("tabs__item","tabItem_AQgk",i?.className,{"tabs__item--active":n===e}),children:r??e},e))})}function u({children:e}){return(0,t.jsx)("div",{className:"margin-top--md",children:e})}function d({className:e,children:n}){return(0,t.jsxs)("div",{className:(0,a.A)(i.G.tabs.container,"tabs-container","tabList_Qoir"),children:[(0,t.jsx)(c,{className:e}),(0,t.jsx)(u,{children:n})]})}function h(e){let n=(0,o.A)(),r=(0,s.OC)(e);return(0,t.jsx)(s.O_,{value:r,children:(0,t.jsx)(d,{className:e.className,children:(0,s.vT)(e.children)})},String(n))}},25237(e,n,r){r.d(n,{OC:()=>h,O_:()=>g,uc:()=>f,vT:()=>u});var t=r(62540),a=r(63696),i=r(49519),s=r(66455),l=r(27611),o=r(78328),c=r(87116);function u(e){return a.Children.toArray(e).filter(e=>"\n"!==e)}function d({value:e,tabValues:n}){return n.some(n=>n.value===e)}function h(e){let n,{defaultValue:r,queryString:t=!1,groupId:u}=e,h=function(e){let{values:n,children:r}=e;return(0,a.useMemo)(()=>{let e=n??a.Children.toArray(r).flatMap(e=>{if(!e)return[];if((0,a.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return[e];let n="string"==typeof e.type?e.type:e.type.name;throw Error(`Docusaurus error: Bad <Tabs> child <${n}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop. 2If you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.`)}).map(({props:{value:e,label:n,attributes:r,default:t}})=>({value:e,label:n,attributes:r,default:t})),t=(0,o.XI)(e,(e,n)=>e.value===n.value);if(t.length>0)throw Error(`Docusaurus error: Duplicate values "${t.map(e=>`'${e.value}'`).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[n,r])}(e),[p,f]=(0,a.useState)(()=>(function({defaultValue:e,tabValues:n}){if(0===n.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!d({value:e,tabValues:n}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}let r=n.find(e=>e.default)??n[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:r,tabValues:h})),[g,m]=function({queryString:e=!1,groupId:n}){let r=(0,i.W6)(),t=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,l.aZ)(t),(0,a.useCallback)(e=>{if(!t)return;let n=new URLSearchParams(r.location.search);n.set(t,e),r.replace({...r.location,search:n.toString()})},[t,r])]}({queryString:t,groupId:u}),[v,x]=function({groupId:e}){let n=e?`docusaurus.tab.${e}`:null,[r,t]=(0,c.Dv)(n);return[r,(0,a.useCallback)(e=>{n&&t.set(e)},[n,t])]}({groupId:u}),b=d({value:n=g??v,tabValues:h})?n:null;return(0,s.A)(()=>{b&&f(b)},[b]),{selectedValue:p,selectValue:(0,a.useCallback)(e=>{if(!d({value:e,tabValues:h}))throw Error(`Can't select invalid tab value=${e}`);f(e),m(e),x(e)},[m,x,h]),tabValues:h,lazy:e.lazy??!1,block:e.block??!1}}let p=(0,a.createContext)(null);function f(){let e=a.useContext(p);if(!e)throw Error("useTabsContext() must be used within a Tabs component");return e}function g(e){return(0,t.jsx)(p.Provider,{value:e.value,children:e.children})}},65665(e,n,r){r.d(n,{A:()=>o});var t=r(62540),a=r(63696),i=r(50547),s=r(49519);function l({name:e,children:n,ref:r}){let o=function(e){let n=e;for(;(0,a.isValidElement)(n);)[n]=a.Children.toArray(n.props.children);if("string"!=typeof n)throw Error(`Could not extract APITable row name from JSX tree: 3${JSON.stringify(e,null,2)}`);return n}(n),c=e?`${e}-${o}
3`:o,u=`#${c}`,d=(0,s.W6)();return(0,i.A)().collectAnchor(c),(0,t.jsx)("tr",{id:c,tabIndex:0,ref:d.location.hash===u?r:void 0,onClick:e=>{let n="TD"===e.target.tagName.toUpperCase(),r=!!window.getSelection()?.toString();n&&!r&&d.push(u)},onKeyDown:e=>{"Enter"===e.key&&d.push(u)},children:n.props.children})}function o({children:e,name:n}){if("table"!==e.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");let[r,i]=a.Children.toArray(e.props.children),s=(0,a.useRef)(null);(0,a.useEffect)(()=>{s.current?.focus()},[s]);let c=a.Children.map(i.props.children,e=>(0,t.jsx)(l,{name:n,ref:s,children:e}));return(0,t.jsxs)("table",{className:"apiTable_e8hp",children:[r,(0,t.jsx)("tbody",{children:c})]})}},43023(e,n,r){var t=r(63696);let a={},i=t.createContext(a);function s(e){let n=t.useContext(i);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),t.createElement(i.Provider,{value:n},e.children)}r.d(n,{R:()=>s,x:()=>l})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.