Add the Vercel Toolbar to your production environment
Learn how to add the Vercel Toolbar to your production environment to enable commenting and collaboration.To enable the toolbar in your production environment, you can add it using the Vercel Chrome Extension, the command menu, or the @vercel/toolbar
package.
You can add the Vercel Toolbar to your production environment using the Vercel Chrome Extension. The extension allows you to access the toolbar on any website hosted on Vercel.
To add the Vercel Toolbar to your production environment:
- Install the Vercel Chrome Extension from the Chrome Web Store
- Ensure that you are logged in to your Vercel account on vercel.com. You must be signed in for the extension to know which domains you own
- Ensure that you have deployed to production. Older deployments do not support injection through the browser extension
To manage the default visibility of the toolbar in production at either a team or project level, see Managing the default visibility of the toolbar.
To enable the toolbar on production environments from the command menu:
- Open a preview deployment of your project
- Select the menu icon in the toolbar
- Scroll down to Enable Vercel Toolbar in Production and select it
- Choose the domain you want to enable the toolbar on
To manage the default visibility of the toolbar in production at either a team or project level, see Managing the default visibility of the toolbar.
To add the Vercel Toolbar to your development or production environments, follow the steps below:
Install the package using the following command:
pnpm i @vercel/toolbar
Then link your local project to your Vercel project with the
vercel link
command using Vercel CLI.terminalvercel link [path-to-directory]
Before using the Vercel Toolbar in a production deployment Vercel recommends conditionally injecting the toolbar. Otherwise, all visitors will be prompted to log in when visiting your site.
The following example demonstrates code that will show the Vercel Toolbar on a production deployment.
components/staff-toolbar.tsx'use client'; import { VercelToolbar } from '@vercel/toolbar/next'; import { useIsEmployee } from 'lib/auth'; // Your auth library export function StaffToolbar() { const isEmployee = useIsEmployee(); return isEmployee ? <VercelToolbar /> : null; }
app/layout.tsximport { Suspense } from 'react'; import { StaffToolbar } from '@components/staff-toolbar'; export default function RootLayout({ children, }: { children: React.ReactNode; }) { return ( <html lang="en"> <body> {children} <Suspense> <StaffToolbar /> </Suspense> </body> </html> ); }
Unlike comments on preview deployments, alerts for new comments won't be sent to a specific user by default. Vercel recommends linking your project to Slack with the integration, or directly mentioning someone when starting a new comment thread in production to ensure new comments are seen
To manage the default visibility of the toolbar in production at either a team or project level, see Managing the default visibility of the toolbar.
By following the steps above, you can add the Vercel Toolbar to your production environment. To manage the default visibility of the toolbar for either your team or project, you can use the following methods:
- Navigate to your Vercel dashboard and make sure that you have selected your team from the scope selector. To manage the toolbar at the project level, ensure that you have selected the project.
- From your dashboard, select the Settings tab.
- In the General section, find Vercel Toolbar.
- Under each environment (Preview and Production), select either On or Off from the dropdown to determine the visibility of the Vercel Toolbar for that environment.
- Once set at the team level, you can optionally choose to allow the setting to be overridden at the project level.
Was this helpful?