# Nightwatch

Polyscope integrates with [Laravel Nightwatch](https://nightwatch.laravel.com) so you can create workspaces directly from Nightwatch issues. When an error or performance issue surfaces in Nightwatch, you can jump straight into a Polyscope workspace to fix it.

![](/images/docs/issue-from-nightwatch.png)

## Connecting Nightwatch

First, connect your Nightwatch account to Polyscope:

1. Open Polyscope and go to **Settings**
2. Find the **Nightwatch** integration and click **Connect**
3. Authenticate with your Nightwatch account

Once connected, Polyscope can access your Nightwatch projects and their issues.

## Linking a Repository to a Nightwatch Project

After connecting your Nightwatch account, you need to link each repository to its corresponding Nightwatch project. This tells Polyscope which Nightwatch issues belong to which codebase.

1. Click the **more actions** menu (three dots) on the repository in the sidebar and select **Settings**
2. In the **Nightwatch** section, select the Nightwatch project that corresponds to this repository
3. Save your changes

You only need to do this once per repository. After linking, Nightwatch issues for that project will be available when creating workspaces.

## Creating Workspaces from Nightwatch Issues

Once a repository is linked to a Nightwatch project, you can create workspaces from Nightwatch issues:

1. Click the **Nightwatch** icon on the repository in the sidebar
2. Browse the list of open issues from your Nightwatch project
3. Select an issue to create a new workspace

The workspace will include the full issue context — error message, stack trace, affected endpoint, and any other details from Nightwatch — giving the agent everything it needs to start diagnosing and fixing the problem.

## Tips

- **One project per repository** — Each repository maps to a single Nightwatch project, matching how Nightwatch organizes monitoring by application.
- **Works with Autopilot** — Combine Nightwatch issues with [Autopilot](/docs/digging-deeper/autopilot) to automatically fix errors as they come in.
