Converting a TypeScript app built using Google AI Studio (Build Mode) into a public, web-based browser application is highly streamlined because Google AI Studio already generates a structured, modern web application—typically a TypeScript/React frontend paired with a Node.js server [0.10]. [1]
You can transition your app from Google AI Studio to the browser using two primary methods: deploying it instantly using Google's native infrastructure, or exporting the code to host it on a popular web platform like Vercel.
Option 1: Native One-Click Deployment (Cloud Run)
If you want the absolute fastest path to a live browser URL without touching any code or local development environments, use Google AI Studio's built-in hosting automation. [1, 2]
- Open your project inside the Google AI Studio workspace. [3]
- Click the Deploy to Cloud Run button in the upper right. [2]
- Google AI Studio will automatically handle the containerization, database configurations, and backend management. [2]
- It will immediately generate a public, shareable live URL where your application runs seamlessly in any web browser. [1, 2]
Option 2: Exporting & Hosting on Custom Web Platforms
If you want to maintain the project yourself, add custom code, or host it on platforms like Vercel or GitHub Pages, you can pull the raw TypeScript files out of Google AI Studio [0.15]. [1, 4]
Step 1: Export the Files
You have two ways to extract the codebase from Google AI Studio [0.15]: [1]
- Direct Download: Go to the app's workspace, navigate to the Code tab, and click Download app to download a ZIP folder containing the complete project code [0.15]. [3]
- GitHub Sync: Connect your project directly to a repository in the GitHub tab under settings to push your generated AI Studio code straight to a repository [0.15]. [1]
Step 2: Handle API Keys Securely ⚠️
The Google Gen AI SDK for JavaScript/TypeScript requires an API key to communicate with the Gemini models. [5]
- Do not hardcode your Google AI Studio API key directly into the TypeScript frontend files. Doing so exposes your key to the public browser console where anyone can steal it. [1]
- Keep the API key stored in a server-side environment variable (like a
.envfile) on your backend server. [1] - Alternatively, if your application is purely client-side and needs production-grade security, look into migrating your logic to Firebase AI Logic to manage secure user access securely from a browser. [5]
Step 3: Deploy to Vercel
If you exported your project to GitHub, you can publish it to the web in seconds: [4]
- Go to Vercel and log in with your GitHub account.
- Click Import Project and select your TypeScript app's repository.
- Under the Environment Variables section, add your
GEMINI_API_KEY(or the respective key variable your app uses). - Click Deploy. Vercel will automatically build the React/TypeScript app and give you a live browser URL. [1, 4]
To help narrow down the exact configuration steps, could you tell me:
- Do you want to continue developing the app locally in an IDE, or do you just want a quick public link?
- Does your app require sensitive data handling or user logins?
0 Comments