Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/itsubaki/qasm-playground/llms.txt

Use this file to discover all available pages before exploring further.

The playground has a single required environment variable. It tells the Next.js backend where the quasar quantum simulator service is running on Google Cloud Run. Without it, every API call returns an error.

GOOGLE_CLOUD_SERVICE_URL

The base URL of the deployed quasar service on Google Cloud Run.
PropertyValue
RequiredYes
Set inVercel project environment variables
Used by/api/simulate, /api/share, /api/edit, /api/validate

Format

https://<service-name>-<hash>-<region>.a.run.app
For example:
https://quasar-a1b2c3d4e5-uc.a.run.app
Google Cloud Run generates this URL when you deploy the service. You can find it in the Cloud Run console under the service’s detail page, listed as the service URL.

What it controls

All four API endpoints in the playground use this variable to forward requests to the quasar gRPC-transcoded service. Internally, each endpoint constructs a request to:
${GOOGLE_CLOUD_SERVICE_URL}/quasar.v1.QuasarService/<Method>
Where <Method> is one of Simulate, Share, Edit, or Validate.

What happens if it is not set

If GOOGLE_CLOUD_SERVICE_URL is missing, every API call returns an HTTP 500 response with the following body:
{
  "error": "GOOGLE_CLOUD_SERVICE_URL is not set"
}
The playground UI will show an error in the results panel when you try to run, share, or load any program.

How to set it in Vercel

1

Deploy quasar to Google Cloud Run

Follow the quasar deployment instructions to deploy the simulator service. Copy the service URL from the Cloud Run console once deployment completes.
2

Open your Vercel project settings

In the Vercel dashboard, navigate to your qasm-playground project and click Settings, then Environment Variables.
3

Add the variable

Set the variable name to GOOGLE_CLOUD_SERVICE_URL and paste the Cloud Run service URL as the value. Apply it to the Production environment (and optionally Preview).
4

Redeploy

Trigger a new deployment so Vercel picks up the new variable. The playground will use it immediately after the deployment completes.
Do not expose this URL in client-side code. The variable is read only on the server inside Next.js API routes (app/api/*/route.ts), so it is never sent to the browser.

Build docs developers (and LLMs) love