---
title: Preflight Scripts in the Laboratory
description:
  Populate headers with environment variables and automate authentication flows for GraphQL
  requests.
date: 2024-12-27
authors: [dimitri]
---

import { Callout } from '@theguild/components'

export const figcaptionClass = 'text-center text-sm mt-2'

We've added Preflight Scripts our GraphQL IDE - Laboratory!

**Preflight Scripts** is a feature that enables you to automatically execute custom code before each
GraphQL request is made. They're especially useful for handling authentication flows like OAuth,
where you may need to claim or refresh an access token, validate credentials, or set up custom
headers - all before the request is sent.

![Demo of Preflight Scripts](../../docs/dashboard/laboratory/editing.png)

Check out [the documentation on Preflight Scripts](/docs/dashboard/laboratory/preflight-scripts) for
information on how to configure, edit, and use them.
