> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peak.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Peakviews quick start

> Get a preview link on your next pull request.

> [!NOTE]
>
> Ask Peak to turn on Peakviews for your workspace.

## Before you start

* Sign in to Peak as an Admin.
* Be an owner of your GitHub organization, or ask an owner to approve the Peakviews GitHub App.
* Keep a [supported setup](https://docs.peak.inc/peakviews/detection.md) on your default branch.

## Turn on previews

1. Open [Previews](https://app.peak.inc/previews).
2. Choose Install on GitHub.
3. Select your repositories on GitHub. Authorize Peakviews when GitHub asks, then return to Peak.
4. Open a repository.
5. Under Setup, check the Source, Public, Services, and Databases that Peak found.
6. Under Keys, enter each key marked Missing and choose Save. Or choose Paste .env or [Import from Render](https://docs.peak.inc/peakviews/environment.md#import-from-render).
7. Choose Turn on previews.

Choose Skip beside a key that previews don't need.
Choose Add repositories to change the selection on GitHub.
Already installed on GitHub? Choose Install on GitHub to connect it.

## Open a pull request

Push a branch to the same repository.
Open a pull request from it.
Check these on the pull request.

| Where | What it shows |
| - | - |
| Peakviews comment | Status, commit, link, and time from push to ready. Peak edits the same comment on each push. |
| Deployment | The Preview (pr-NUMBER) environment. Choose View deployment to open the preview. |
| Peakviews check | The link, seconds for each phase (Fetch, Build, Start, Health, Ready), and the end of the log |

Expect no preview for pull requests from forks.

## Fix a failed preview

Open the Peakviews check and read the log.

| Reason | What to do |
| - | - |
| Missing keys | Add the keys in Previews, then push again. |
| Build failed | Fix the build and push again. |
| The app stopped | Check the log for the crash and push a fix. |
| Build took too long | Get the build and health checks under 45 minutes. |
| Too many live previews | Close pull requests you no longer need. |
| No capacity | Push again later. |
| The preview plan is invalid | Fix the problems shown under Setup in Previews. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.