# CLAUDE
Source: https://docs.optidev.ai/CLAUDE
# OptiDev Documentation Site
User-facing documentation for docs.optidev.ai. Built with Mintlify.
## Writing Guidelines
* Helpful, optimistic, concise
* Minimalist style, no fluff, no jargon
* 80% for business users (analysts, marketers) who know SQL but not code
* Focus on: "the agent builds it for you" and "click here in Dashboard"
* End each page with "For Developers" section for technical reference
## Directory Structure
```
docs/
├── docs.json # Navigation, theme, branding config
├── index.mdx # Landing page
├── get-started/ # Onboarding
│ ├── quickstart.mdx # First project walkthrough
│ ├── prompt-guide.mdx # How to write good prompts
│ └── prompt-library.mdx # Example prompts by category
├── features/ # Platform capabilities
│ ├── agent-mode.mdx # AI assistant (5 modes)
│ ├── visual-editor.mdx # Point-and-click editing
│ ├── code-editor.mdx # VS Code in browser
│ ├── image-generation.mdx # AI image creation
│ ├── publish-your-app.mdx # Build and deploy
│ ├── custom-domain.mdx # DNS setup
│ └── publish-to-optisigns.mdx # Digital signage
├── optidev-cloud/ # Backend-as-a-service
│ ├── how-to-use.mdx # Activation and overview
│ ├── database.mdx # PostgreSQL access
│ ├── edge-functions.mdx # Serverless functions
│ ├── storage.mdx # File storage
│ └── auth.mdx # User authentication
├── security/ # Enterprise features
│ ├── securing-your-app.mdx # Best practices
│ ├── single-sign-on.mdx # SSO overview
│ ├── sso-okta.mdx # Okta setup guide
│ └── sso-azure-ad.mdx # Azure AD setup guide
├── billing/ # Plans and payments
│ ├── plans-and-credits.mdx # Pricing tiers
│ └── payment-methods.mdx # Stripe integration
├── images/ # Static images for docs
├── logo/ # Brand assets
├── snippets/ # Reusable MDX snippets
└── claude-dev/ # Development notes (not published)
```
## Local Development
```bash theme={null}
npm run dev # localhost:3009
```
## Deployment
Push to `main` → auto-deploys to docs.optidev.ai
## Key Files
| File | Purpose |
| ----------- | ------------------------------------------ |
| `docs.json` | Navigation structure, colors, navbar links |
| `index.mdx` | Homepage hero and feature cards |
## Image Components
Use JSX `
` with `style` for sized images:
```mdx theme={null}

```
## Reference
* Main product: the main product repo is `optiedge-kaze`. If you need to reference the main product code, ask the user to provide the path to their local clone.
# Payment Methods
Source: https://docs.optidev.ai/billing/payment-methods
How payments work in OptiDev
## Secure Payments with Stripe
OptiDev uses [Stripe](https://stripe.com) to process all payments. Your payment information is handled securely by Stripe — we never store your card details on our servers.
***
## Accepted Payment Methods
When you subscribe or purchase credits, Stripe Checkout accepts:
* **Credit cards** — Visa, Mastercard, American Express, Discover
* **Debit cards** — Most major debit cards
Available payment methods may vary by region. Stripe automatically shows the options available in your location.
***
## Adding a Payment Method
1. Go to **Settings** → **Billing**
2. Click **Upgrade** to start a subscription
3. Enter your payment details in Stripe Checkout
4. Your payment method is saved for future renewals
***
## Updating Your Payment Method
1. Go to **Settings** → **Billing**
2. Click **Manage Billing**
3. You'll be redirected to the Stripe billing portal
4. Click **Payment methods** → **Add payment method**
5. Enter your new card details
6. Set it as your default payment method
***
## Removing a Payment Method
1. Go to **Settings** → **Billing**
2. Click **Manage Billing**
3. In the billing portal, go to **Payment methods**
4. Click the card you want to remove
5. Select **Remove**
You must have at least one valid payment method if you have an active subscription.
***
## Invoices and Receipts
After each payment, you'll receive an email receipt from Stripe. You can also access all invoices:
1. Go to **Settings** → **Billing**
2. Click **Manage Billing**
3. View your **Invoice history**
4. Download invoices as PDF
***
## Payment Security
* **PCI compliant** — Stripe is certified to PCI Service Provider Level 1
* **Encrypted** — All payment data is encrypted in transit and at rest
* **No card storage** — OptiDev never sees or stores your full card number
***
## FAQ
Common reasons include insufficient funds, incorrect card details, or your bank blocking the transaction. Try a different card or contact your bank.
You're charged immediately when you subscribe or purchase credits. Subscriptions renew automatically at the start of each billing cycle.
Contact support at [support@optidev.ai](mailto:support@optidev.ai) for refund requests. Refunds are evaluated on a case-by-case basis.
Currently, we only accept credit and debit cards through Stripe.
# Plans & Credits
Source: https://docs.optidev.ai/billing/plans-and-credits
Understand OptiDev pricing plans and how credits work
## Plans Overview
OptiDev offers three plans to fit your needs:
| Plan | Monthly | Yearly | Credits |
| ------------ | ---------- | ---------- | ---------------------- |
| **Free** | \$0 | — | 100 credits (one-time) |
| **Standard** | \$25/month | \$300/year | 100 credits/month |
| **Pro** | \$50/month | \$600/year | 200 credits/month |
All plans include Claude Sonnet 5, Claude 4.5 Haiku, GPT-5.6 Terra, Qwen 3.5 Plus, and MiMo V2.5 Pro. **Pro and Enterprise plans also unlock Claude 4.7 Opus** for the most demanding tasks — see [Choosing a Model](/features/choosing-a-model).
Yearly plans bill annually but credits refill each month — same monthly amount as monthly plans, just at a discounted subscription price.
***
## What Are Credits?
Credits are how OptiDev measures AI usage. Every time the agent builds, edits, or generates something for you, it uses credits based on the complexity of the task.
**Simple tasks** (small edits, quick fixes) use fewer credits.
**Complex tasks** (building new features, large changes) use more credits.
### Credit Allocation
| Plan | Monthly Billing | Yearly Billing |
| -------- | ---------------------- | ----------------------------------- |
| Free | 100 credits (one-time) | — |
| Standard | 100 credits/month | 100 credits/month (billed annually) |
| Pro | 200 credits/month | 200 credits/month (billed annually) |
### Credit Reset
* **Monthly plans**: Credits reset at the start of each billing cycle
* **Yearly plans**: Credits refill each month, just like monthly plans — only the billing is annual
* **No rollover**: Unused credits don't carry over to the next cycle
***
## Checking Your Balance
1. Go to your **Dashboard**
2. Click **Settings** → **Billing**
3. Your current credit balance and usage are displayed
You'll also see a warning when your credits are running low.
***
## Running Out of Credits
When your credit balance reaches zero:
* The agent will notify you that credits are depleted
* You won't be able to use AI features until you have more credits
* Your app and all your work remain safe and accessible
### Options When Out of Credits
1. **Wait for reset** — Monthly plans reset at the start of each billing cycle
2. **Upgrade your plan** — Get more credits instantly with a higher plan
3. **Buy a top-up** — Purchase additional credits anytime
***
## Upgrading Your Plan
### From Free to Paid
1. Go to **Settings** → **Billing**
2. Choose Standard or Pro
3. Select monthly or yearly billing
4. Complete payment through Stripe
5. Credits are added immediately
### From Standard to Pro
1. Go to **Settings** → **Billing**
2. Click **Upgrade to Pro**
3. You'll receive prorated credits for the remainder of your billing cycle
4. Payment is processed automatically
***
## Managing Your Subscription
### Change Payment Method
1. Go to **Settings** → **Billing**
2. Click **Manage Billing**
3. You'll be redirected to the billing portal
4. Update your payment method
### Cancel Subscription
1. Go to **Settings** → **Billing**
2. Click **Manage Billing**
3. Select **Cancel subscription**
4. Your plan remains active until the end of the billing period
5. After cancellation, you return to the Free plan
### View Invoices
1. Go to **Settings** → **Billing**
2. Click **Manage Billing**
3. View and download past invoices
***
## FAQ
Your projects and apps are safe. You'll still have access to everything you've built. You just won't be able to use AI features until you resubscribe or purchase credits.
Yes. Go to **Manage Billing** and change your subscription. The change takes effect at the end of your current billing period.
No. Credits reset each month — for both monthly and yearly plans. Yearly subscribers receive the same monthly allocation as monthly subscribers; the yearly option just discounts the subscription price.
Credit usage depends on the complexity of the task. Simple edits use fewer credits than building new features. You can always check your balance in Settings → Billing.
Every new account starts with 100 free credits so you can try OptiDev before subscribing.
# 00 init
Source: https://docs.optidev.ai/claude-dev/2025-12-10-init/00-init
Writing guideline: be helpful, optimistic, and concise.
Minimalist style, no fluff, no jargon, no marketing speak.
No codes, 80% of article should focus on users like Business Analysts, Marketing Analysts, with little technical knowledge, they may know how to write simple SQL, get API keys, but not how to code or know what is Environment Variables.
Focus on: user agent to build app do things for you. Click around in our Platform, Dashboard where make sense.
At the end you can For Developers section with technical reference for developers as matter of facts.
Let's make plan to write these pages.
List out sections in each page and 3 key bullet points per page.
This project is docs.optidev.ai - using Mintlify for it.
Our objetive today is to:
* Update branding to match purple color of OptiDev
* explore /Users/henryle/optisigns/optiedge/logo folder find proper logo for the page and favicon and update it
Clean up and setup layout
-Hide API reference
-hide Documentation and Blogs, we just need the Getting Started ... main documentations for now
Let's Set up Docs structure like this, just create the blank pages for now. I will give you details on each page as we go.
Get started
* Quickstart
* Prompt Guide
* Prompt Library
Features
* Agent Mode
* Visual Editor
* Code Editor
* Image generation
* Publish your app
* Custom domain
* Publish to OptiSigns Screens
OptiDev Cloud
* How to use
* Database
* Edge Functions
* Storage
* Auth
Security
* Securing your app (has 4 sections):
* Public vs Private app
* Securely Display your app on OptiSigns Screens
* Adding Auth to your app
* Run Security Review on your app
* Single sign-on SSO/SAML
Billing
* Plans & Credits
* Payment methods
read our project get context on how our platform works, features, from user point of view prepare to write documetnation for docs.optidev.ai in
/Users/henryle/optisigns/optiedge/docs - our target documents structure is
Get started
* Quickstart
* Prompt Guide
* Prompt Library
Features
* Agent Mode
* Visual Editor
* Code Editor
* Image generation
* Publish your app
* Custom domain
* Publish to OptiSigns Screens
OptiDev Cloud
* How to use
* Database
* Edge Functions
* Storage
* Auth
Security
* Securing your app
* Single sign-on SSO/SAML
Billing
* Plans & Credits
* Payment methods
just get highlevel context for now I will tell you which page, secion to write next
replan Page 2: Single Sign-On (SSO/SAML) - read /Users/henryle/optisigns/optiprime/optiprime-idm - we use OptiPrime to handl Auth, and yes focus on IT Admin to configure their system so user can login to
Write 2 pages guide 1 for Okta and 1 for Azure AD
# Optidev cloud
Source: https://docs.optidev.ai/claude-dev/2025-12-10-init/docs-to-write/optidev-cloud
Write it, but change Claude Agent to OptiDev Agent
OptiDev Cloud Documentation Plan (Revised)
Target Audience: Users with light technical experience (can write basic SQL, copy API keys) but may not understand environment variables or infrastructure concepts.
Writing Approach: Lead with "what you can do" and "how to do it" with UI-focused instructions. Technical details at the end of each page as optional reference.
***
1. How to Use (optidev-cloud/how-to-use.mdx)
Sections:
What is OptiDev Cloud
* A ready-to-use backend for your app - includes a database to store data, user login system, and file storage
* No separate accounts or setup needed - activate it with one click from your project
* Works automatically with Claude Agent - just ask Claude to "save user data" or "add login" and it handles the rest
Activating OptiDev Cloud
* Open your project, click the "OptiDev Cloud" tab, then click "Activate OptiDev Cloud"
* Pick a region closest to your users (e.g., US East for North America, Frankfurt for Europe)
* Wait 1-2 minutes for setup - you'll see a green "Active" badge when it's ready
Finding Your Connection Details
* After activation, the "Connection Info" tab shows your API URL and keys
* Click the "Copy" button next to any value to copy it to your clipboard
* The "Connect" button shows your database connection string for tools like database clients
For Developers (Technical Reference)
* Environment variables VITE\_SUPABASE\_URL and VITE\_SUPABASE\_PUBLISHABLE\_KEY are auto-injected into .env.local
* Use the Supabase JavaScript client (@supabase/supabase-js) for frontend integration
* Connection string uses session pooler (port 5432) for PostgreSQL compatibility
***
2. Database (optidev-cloud/database.mdx)
Sections:
What is the Database
* A place to store and organize your app's data in tables (like spreadsheets with rows and columns)
* Query your data using SQL - a simple language for asking questions like "show me all users" or "find orders over \$100"
* Your data is automatically backed up and can be accessed from anywhere in the world
Browsing Your Tables
* Click the "Database" tab to see all your tables listed in the left sidebar
* Click any table name to see its data - it automatically loads the first 10 rows
* Use the pagination controls at the bottom to browse through more rows (10, 25, 50, or 100 at a time)
Writing and Running Queries
* Type SQL in the editor area, for example: SELECT \* FROM users WHERE created\_at > '2024-01-01'
* Click "Execute Query" (or press the play button) to run your query and see results
* Double-click any cell in the results to edit it directly - press Enter to save or Escape to cancel
Exporting Your Data
* Click the menu icon (three dots) above results to export data as JSON, CSV, or Excel files
* Select specific rows using checkboxes, then export just those rows
* Use "Copy as SQL" to get INSERT statements you can run elsewhere
For Developers (Technical Reference)
* Tables are created in the public schema; use information\_schema queries for metadata
* Cell editing requires an id column in the table for row identification
* Direct SQL execution via pg client with session pooler connection
***
3. Edge Functions (optidev-cloud/edge-functions.mdx)
Sections:
What are Edge Functions
* Small pieces of code that run on the server - useful for things you can't do in the browser (like sending emails or processing payments)
* They run close to your users worldwide, making your app faster
* Write them in TypeScript (similar to JavaScript) and deploy with one click
Creating Your First Function
* Click "Create Sample Function" to generate a hello-world example in your project
* Find it in your project files under supabase/functions/hello-world/index.ts
* Edit the code in your editor - Claude Agent can help you modify it for your needs
Deploying Functions
* In the "Edge Functions" tab, you'll see functions in your workspace listed under "Workspace Functions"
* Click "Deploy" next to any function to publish it to OptiDev Cloud
* Once deployed, you'll see it under "Deployed Functions" with a green checkmark
Testing Your Functions
* Click "Test" next to any deployed function to open the test panel
* Choose the HTTP method (GET, POST, etc.) and add any data your function expects
* Click "Send Request" to see the response - useful for debugging before connecting to your app
Calling Functions from Your App
* Click "Copy URL" to get the function's web address
* Call this URL from your app using fetch or any HTTP library
* The function runs on the server and returns data to your app
For Developers (Technical Reference)
* Functions use Deno runtime with TypeScript support
* CORS headers must be handled in your function code (sample includes this)
* Access secrets via Deno.env.get('SECRET\_NAME') - manage secrets in the Secrets tab
***
4. Storage (optidev-cloud/storage.mdx)
Sections:
What is Storage
* A place to store files like images, PDFs, videos, and documents for your app
* Files are delivered fast worldwide through a CDN (content delivery network)
* Control who can access files - make them public for everyone or private for logged-in users only
Understanding Buckets
* Files are organized into "buckets" - think of them like folders for different types of content
* Create buckets for different purposes (e.g., "avatars" for profile pictures, "documents" for uploads)
* Each bucket can have its own access rules - public or private
Uploading Files
* Use the Supabase client in your app to upload files from user input (like file pickers)
* Files get a unique URL you can save to your database and display in your app
* Large files are handled automatically with progress tracking
Getting File URLs
* Public files have a direct URL anyone can access - great for images on your website
* Private files need a "signed URL" that expires after a set time - good for sensitive documents
* Copy file URLs from the dashboard or generate them in code
For Developers (Technical Reference)
* Storage is S3-compatible with Supabase Storage API wrapper
* Use supabase.storage.from('bucket').upload() for uploads with RLS policy checks
* Signed URLs support custom expiration times (default 60 seconds)
***
5. Auth (optidev-cloud/auth.mdx)
Sections:
What is Auth
* A complete login system for your app - lets users create accounts and sign in securely
* Supports email/password, phone number (SMS codes), and "Sign in with Google"
* Handles password resets, email verification, and session management automatically
Enabling Sign-in Methods
* Click the "Auth" tab and you'll see available sign-in methods: Email, Phone, and Google
* Click on any method to see its settings and toggle it on or off
* Each method shows "Enabled" or "Disabled" - click to configure
Email Sign-in
* The most common option - users enter email and password to create an account or log in
* "Confirm Email" setting requires users to click a link in their email before accessing your app
* Great for most apps where you want to verify real email addresses
Phone Sign-in
* Users enter their phone number and receive a one-time code via SMS
* Good for apps where users prefer not to remember passwords
* Requires SMS provider setup (configured in the Phone settings panel)
Google Sign-in
* Users click "Sign in with Google" and use their existing Google account
* Fastest option for users - no new password to create or remember
* Requires setting up Google OAuth credentials (the settings panel guides you through this)
User Management Settings
* "Allow New Users to Sign Up" - turn off to prevent new registrations (useful for invite-only apps)
* "Enable Anonymous Users" - let people use your app without creating an account first
* "Allowed URLs" - list the web addresses where sign-in redirects are allowed
For Developers (Technical Reference)
* Auth integrates with Row Level Security (RLS) policies using auth.uid() in PostgreSQL
* JWT tokens are managed automatically by the Supabase client
* Use supabase.auth.signInWithPassword(), signInWithOtp(), or signInWithOAuth() for each method
***
This revised structure:
* Leads with plain-language explanations of what things do
* Uses UI-focused step-by-step instructions
* Puts technical details in clearly labeled "For Developers" sections at the end
* Avoids jargon in the main content (no "environment variables" until the tech section)
# Prompt library
Source: https://docs.optidev.ai/claude-dev/2025-12-10-init/docs-to-write/prompt-library
# Quickstart
Source: https://docs.optidev.ai/claude-dev/2025-12-10-init/docs-to-write/quickstart
Quickstart article should have
# Securing your app
Source: https://docs.optidev.ai/claude-dev/2025-12-10-init/docs-to-write/securing-your-app
# Agent Mode
Source: https://docs.optidev.ai/features/agent-mode
Your AI assistant that builds, fixes, and explains your app
## What is Agent Mode?
Agent Mode is your AI-powered assistant inside OptiDev. Instead of writing code yourself, you describe what you want in plain English, and the agent builds it for you.
Think of it as having a developer on your team who's always available. You can ask it to:
* Build new features ("Add a contact form with email validation")
* Fix problems ("The button isn't working, can you fix it?")
* Explain how things work ("How does the login flow work?")
* Make changes ("Change the header color to blue")
## Working with the Agent
The agent has two modes that work together automatically:
### Plan Mode
When you ask for something, the agent first creates a plan. It shows you what it intends to do before making changes. Review the plan and approve it to continue.
### Execute Mode
Once you approve the plan, the agent writes code and makes changes to your project. You'll see files being created or modified in real-time.
| Mode | Access Level | Use Case |
| --------- | ----------------- | ------------------------------------------------- |
| `plan` | Read-only | Architecture planning, reviewing proposed changes |
| `execute` | Full write access | Feature implementation, bug fixes, modifications |
## How to Use Agent Mode
1. Open your project in OptiDev
2. Look for the **Agent** panel on the right side
3. Type your request in plain English
4. Watch the agent work and respond to any questions it asks
5. Review the changes in your project
## Tips for Better Results
**Be specific about what you want**
* Good: "Add a signup form with name, email, and password fields"
* Vague: "Add a form"
**Describe the outcome you need**
* Good: "When users click Submit, save their data and show a success message"
* Vague: "Make the form work"
**Ask follow-up questions**
The agent remembers your conversation. If something isn't right, just say "Make the button bigger" or "Change the color to red" without repeating the whole context.
**Let the agent handle errors**
If you see an error message, copy and paste it to the agent. It can usually diagnose and fix the problem.
## Auto-Save and History
Your conversation with the agent is saved automatically. If you close the browser and come back, you can pick up where you left off.
The agent also auto-commits your changes to version history, so you can always roll back if needed.
# Choosing a Model
Source: https://docs.optidev.ai/features/choosing-a-model
Pick the AI model that builds your app — and know when to switch
## The model behind the agent
Every time OptiDev Agent builds something, it's using an AI model. You choose which one.
**Start with Claude Sonnet 5.** It's the default, it's the best all-rounder, and most people never need to change it. Switch models when you have a specific reason — a task that's too hard, a task too small to spend much on, or a project too big to fit in one conversation.
You can change models any time, even mid-project. Your work isn't tied to a model.
***
## Switching Models
### For one project
At the bottom of the Agent chat box, click the model name. The picker groups models into **Anthropic** and **Other providers**, and each row shows two meters at a glance:
| Meter | What it tells you |
| ----------------------------- | ----------------------------------------------------------------------- |
| **Intelligence** (brain icon) | How capable the model is on hard, multi-step work |
| **Cost** (dollar signs) | How fast it burns your credits — one sign is cheapest, five is priciest |
Hover any model for a longer description, what it's best for, and its speed rating.
### For every new project
Go to **Settings** → **Workspace** tab → **AI Settings** and set your **Default Model**. New projects that don't have their own preference will use it.
***
## Models Available
### Anthropic
| Model | Best for | Plan |
| -------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------ |
| **Claude Sonnet 5** | The default. Near-Opus reasoning with strong coding and tool use, at a lower price. Best pick for most work. | All plans |
| **Claude 4.7 Opus** | The smartest option. Multi-file refactors, deep reasoning, and tricky bugs you need fixed right the first time. | Pro and Enterprise |
| **Claude 4.5 Haiku** | Fastest and cheapest Claude. Renames, copy tweaks, small edits, tight iteration. | All plans |
### Other providers
| Model | Best for | Plan |
| ----------------- | ------------------------------------------------------------------------------------------------------ | --------- |
| **GPT-5.6 Terra** | OpenAI's newest frontier model. Strongest reasoning in the GPT-5 line — good for hard multi-file work. | All plans |
| **Qwen 3.5 Plus** | Sonnet-class coding at a fraction of the price. Good for long sessions on a budget. | All plans |
| **MiMo V2.5 Pro** | A reasoning specialist — strong on math and structured logic, though slower and narrower. | All plans |
**Claude 4.7 Opus needs a Pro plan.** On Free and Standard it appears in the picker with a crown icon and an **Upgrade plan to use** button. Every other model works on every plan, including Free.
***
If the agent is stuck on a bug after a couple of attempts, switching to a more capable model is often faster than re-prompting the same one.
***
## Which Should I Pick?
Leave it on **Claude Sonnet 5**. Come back to this page when you hit something it struggles with.
Switch to **Claude 4.7 Opus** (Pro) or **GPT-5.6 Terra**. Both are built for hard reasoning. Ask it to analyze before changing anything: *"Analyze this issue deeper and come up with a plan to fix it. Don't make changes yet."*
Stay on **Claude Sonnet 5** or move up to **Claude 4.7 Opus** — the stronger the model, the better it holds a large project in its head. It also helps to start a fresh session: *"Read through the project to understand the current state, then…"*
Use **Qwen 3.5 Plus** or **Claude 4.5 Haiku**. Both are far cheaper per task and fine for straightforward changes.
***
## For Developers
### Model IDs
Anthropic models resolve server-side through `AppConfigService.getClaudeModel()`, so the ID can be updated in the `app_configs` table without a deploy:
| Picker tier | Resolved model ID |
| ----------- | --------------------------- |
| `opus` | `claude-opus-4-7` |
| `sonnet` | `claude-sonnet-5` |
| `haiku` | `claude-haiku-4-5-20251001` |
Non-Anthropic models are addressed by their OpenRouter IDs: `openai/gpt-5.6-terra`, `qwen/qwen3.5-plus-02-15`, `xiaomi/mimo-v2.5-pro`.
### Two engines
A model key containing `/` routes to the **OpenCode** engine (OpenRouter-backed); keys without one use the **Claude** engine directly. The stored workspace default is a key, not an ID — `claude-4-sonnet` is a legacy key that resolves to the current Sonnet.
Selecting an unavailable or unknown model falls back to the default rather than erroring, so a model can be retired without breaking saved preferences.
### Plan gating
Access is by tier, not by individual model — every non-Anthropic model is registered at the `sonnet` tier:
| Plan | Tiers available |
| ---------- | ------------------------- |
| Free | `haiku`, `sonnet` |
| Standard | `haiku`, `sonnet` |
| Pro | `haiku`, `sonnet`, `opus` |
| Enterprise | `haiku`, `sonnet`, `opus` |
Defaults live in code and are overridable per environment via `app_configs.config.planFeatures`.
### Credit calculation
```
credits = costUsd / creditUsdRate
```
Credits are derived from actual API cost, which is why model choice changes consumption directly. The rate is configurable (`config.credits.usdRate`). Per-model spend is aggregated from `credit_transactions` and surfaced as **Usage by Model** on the billing page.
***
## What's Next?
Write prompts that get better results from any model.
See how credits are allocated and what each plan includes.
# Code Editor
Source: https://docs.optidev.ai/features/code-editor
Full VS Code experience in your browser
## What is Code Editor?
Code Editor gives you access to VS Code directly in your browser. It's the same editor professional developers use, but you don't need to install anything.
Most users let the agent write code for them, but Code Editor is there when you want to:
* See exactly what files exist in your project
* Make small text changes yourself
* Review what the agent has done
* Explore and learn how your app works
## Navigating Files
### File Explorer
The left sidebar shows all your project files and folders:
* Click a folder to expand it
* Click a file to open it
* Right-click for options (rename, delete, new file)
### Common Folders
| Folder | What's Inside |
| ------------- | ------------------------------- |
| `src/` | Your app's main code |
| `public/` | Images, icons, and static files |
| `components/` | Reusable pieces of your app |
### Opening Multiple Files
* Click a file to open it
* Files appear as tabs at the top
* Click tabs to switch between files
## When to Use Code Editor vs Agent
### Use Agent Mode When...
* You want to add features or make changes
* Something is broken and needs fixing
* You're not sure how to do something
* You want to change multiple files at once
### Use Code Editor When...
* You want to fix a typo or small text error
* You're curious about how something works
* You want to review recent changes
* You need to copy text from your code
## Making Quick Edits
1. Find and open the file you want to edit
2. Click where you want to make a change
3. Type your edit
4. The file saves automatically
If you're unsure about a change, ask the agent instead. It's easy to accidentally break something by editing the wrong spot.
## Search and Find
* **Find in file**: `Cmd/Ctrl + F`
* **Find in all files**: `Cmd/Ctrl + Shift + F`
* **Go to file**: `Cmd/Ctrl + P`, then type the filename
## Terminal
At the bottom of Code Editor, you'll see a Terminal panel. This is for running commands—useful for developers but not needed for most tasks.
If you need something done in the terminal, just ask the agent. It can run commands for you.
# Custom Domain
Source: https://docs.optidev.ai/features/custom-domain
Use your own domain for your published app
## Why Use a Custom Domain?
By default, your app is available at `yourproject.dev.optidev.com`. A custom domain lets you use your own address, like:
* `app.yourcompany.com`
* `dashboard.mybusiness.com`
* `tools.myteam.io`
Custom domains look more professional and are easier for your users to remember.
## Connecting Your Domain
### What You'll Need
* A domain you own (purchased from GoDaddy, Namecheap, Google Domains, etc.)
* Access to your domain's DNS settings
### Step-by-Step Setup
1. **Open Domain Settings**
* Go to your project in OptiDev
* Click **Settings** → **Domain**
* Click **Add Custom Domain**
2. **Enter Your Domain**
* Type your domain (e.g., `app.yourcompany.com`)
* Click **Continue**
3. **Add DNS Record**
* OptiDev shows you a DNS record to add
* Go to your domain provider's website
* Find DNS settings (sometimes called "DNS Management" or "Name Servers")
* Add the record OptiDev gives you
4. **Verify**
* Return to OptiDev
* Click **Verify Domain**
* Wait a few minutes for DNS to update (can take up to 24 hours, but usually faster)
5. **Done!**
* Once verified, your domain is connected
* Your app is now accessible at your custom domain
### DNS Record Types
OptiDev will ask you to add one of these:
| Record Type | When Used | Example |
| ----------- | ----------------------------------------- | --------------------------------------- |
| **CNAME** | For subdomains like `app.yourcompany.com` | Points to `yourproject.dev.optidev.com` |
| **TXT** | For verification | Proves you own the domain |
If you're unsure how to add DNS records, search "\[your domain provider] add CNAME record" for specific instructions.
## SSL and Security
### Automatic HTTPS
Every custom domain gets a free SSL certificate automatically. This means:
* Your site uses `https://` (secure connection)
* Visitors see the padlock icon in their browser
* Data is encrypted between your users and your app
You don't need to do anything—SSL is set up when you connect your domain.
### Certificate Renewal
SSL certificates renew automatically. No action needed on your part.
## Troubleshooting
### "Domain not verified"
DNS changes can take time to spread across the internet. Wait 15-30 minutes and try verifying again. In rare cases, it can take up to 24 hours.
### "SSL certificate pending"
After verification, SSL setup takes a few minutes. Your site may show a security warning briefly. Wait 5-10 minutes and refresh.
### "Domain already in use"
Each domain can only be connected to one project. If you've used this domain before, remove it from the old project first.
## Removing a Custom Domain
1. Go to **Settings** → **Domain**
2. Find the domain you want to remove
3. Click **Remove**
4. Your app returns to using the default `*.dev.optidev.com` URL
# GitHub Integration
Source: https://docs.optidev.ai/features/github-integration
Connect your projects to GitHub for version control and collaboration
## Why Connect to GitHub?
GitHub integration lets you:
* **Back up your code** - Your project is safely stored on GitHub
* **Collaborate with your team** - Others can view and contribute to your code
* **Track changes** - See the history of every update
* **Import existing projects** - Bring your GitHub repos into OptiDev
## Connecting Your GitHub Account
Before linking projects, you need to connect your GitHub account to OptiDev.
### Step-by-Step
1. Go to **Settings** (bottom of the sidebar)
2. Select the **GitHub** tab
3. Click **Connect GitHub Account**
4. GitHub opens in a new window
5. Review the permissions and click **Authorize**
6. You're redirected back to OptiDev
Your GitHub account now appears in the Connections list.
You can connect multiple GitHub accounts if you use different accounts for personal and work projects.
## Push Your Project to GitHub (starting with OptiDev)
Have an OptiDev project you want to back up or share? Push it to GitHub.
### Create a New Repository
1. Open your project in OptiDev
2. Click the **GitHub** button in the toolbar
3. Select your GitHub account
4. Choose **Create new repository**
5. Enter a repository name
6. Select the owner (your account or an organization)
7. Choose public or private
8. Click **Transfer**
Your project code is now on GitHub.
### Connect to an Existing Repository
1. Open your project in OptiDev
2. Click the **GitHub** button
3. Select your GitHub account
4. Choose **Use existing repository**
5. Select the repository from the list
6. Click **Connect**
## Import from GitHub (starting with a repo)
Already have a project on GitHub? Import it directly into OptiDev.
1. From the dashboard, click **New Project**
2. Select **Import from GitHub**
3. Choose your GitHub account
4. Browse or search for the repository
5. Select the branch to import
6. Click **Import**
OptiDev clones the repository and sets up your development environment automatically.
### Deployment Compatibility
OptiDev can deploy **Vite-based projects** (React, Vue, etc.). Other project types like Next.js, Python, or Node.js backends can be developed in OptiDev but need external hosting for deployment.
| Project Type | Development | Deployment |
| ----------------- | ----------- | ---------------- |
| Vite (React, Vue) | Yes | Yes |
| Next.js | Yes | External hosting |
| Python | Yes | External hosting |
| Node.js backend | Yes | External hosting |
## Syncing Changes
Once your project is connected to GitHub (either by pushing or importing), syncing is automatic.
### Automatic Push
OptiDev automatically pushes your changes to GitHub every time you save (commit). You don't need to do anything—every change appears on GitHub within seconds.
### Pulling Updates
If there are new changes to your GitHub repository, you can pull them into OptiDev.
1. Open your project
2. Click the **GitHub** button
3. Click **Pull**
4. Changes from GitHub are merged into your project
If you have unsaved changes in OptiDev, commit them first to avoid conflicts.
### Viewing Your Commits
* On **GitHub**: Go to your repository and click "Commits"
* In **OptiDev**: Open your project and click on the icon (Version History)
## Organization Access
For organization repositories, you may need to grant OptiDev access:
1. Go to **Settings** → **GitHub**
2. Click **Install App on Org** next to your connection
3. Select your organization on GitHub
4. Choose which repositories OptiDev can access
5. Click **Install**
This gives OptiDev access to organization repos, even if team members change.
## Disconnecting
### Unlink a Project
1. Open your project
2. Click the **GitHub** button
3. Click **Disconnect**
Your project stays in OptiDev, but changes no longer sync to GitHub.
### Remove GitHub Account
1. Go to **Settings** → **GitHub**
2. Find the account to remove
3. Click the trash icon
4. Confirm removal
All projects linked to that account are unlinked automatically.
## Troubleshooting
### "Permission denied" when pushing
Your GitHub token may have expired. Go to Settings → GitHub, remove the connection, and reconnect.
### Changes not appearing on GitHub
Check that GitHub sync is enabled:
1. Open your project
2. Click the **GitHub** button
3. Ensure the toggle is on
### Can't see organization repositories
You need to install the OptiDev app on your organization. Click **Install App on Org** in Settings → GitHub.
### Import shows errors but project works
Some warnings during import are normal (like missing optional configs). If your project runs correctly, you can ignore them.
# GitLab Integration
Source: https://docs.optidev.ai/features/gitlab-integration
Connect your projects to GitLab for version control and collaboration
## Why Connect to GitLab?
GitLab integration lets you:
* **Back up your code** - Your project is safely stored on GitLab
* **Collaborate with your team** - Others can view and contribute to your code
* **Track changes** - See the history of every update
* **Import existing projects** - Bring your GitLab repos into OptiDev
## Connecting Your GitLab Account
Before linking projects, you need to connect your GitLab account to OptiDev.
### Step-by-Step
1. Go to **Settings** (bottom of the sidebar)
2. Select the **GitLab** tab
3. Click **Connect GitLab Account**
4. GitLab opens in a new window
5. Review the permissions and click **Authorize**
6. You're redirected back to OptiDev
Your GitLab account now appears in the Connections list.
You can connect multiple GitLab accounts if you use different accounts for personal and work projects.
## Push Your Project to GitLab (starting with OptiDev)
Have an OptiDev project you want to back up or share? Push it to GitLab.
### Create a New Repository
1. Open your project in OptiDev
2. Click the **GitLab** button in the toolbar
3. Select your GitLab account
4. Choose **Create new repository**
5. Enter a repository name
6. Select the owner (your account or a group)
7. Choose private, internal, or public visibility
8. Click **Transfer**
Your project code is now on GitLab.
### Connect to an Existing Repository
1. Open your project in OptiDev
2. Click the **GitLab** button
3. Select your GitLab account
4. Choose **Use existing repository**
5. Select the repository from the list
6. Click **Connect**
## Import from GitLab (starting with a repo)
Already have a project on GitLab? Import it directly into OptiDev.
1. From the dashboard, click **New Project**
2. Select **Import from GitLab**
3. Choose your GitLab account
4. Browse or search for the repository
5. Select the branch to import
6. Click **Import**
OptiDev clones the repository and sets up your development environment automatically.
### Deployment Compatibility
OptiDev can deploy **Vite-based projects** (React, Vue, etc.). Other project types like Next.js, Python, or Node.js backends can be developed in OptiDev but need external hosting for deployment.
| Project Type | Development | Deployment |
| ----------------- | ----------- | ---------------- |
| Vite (React, Vue) | Yes | Yes |
| Next.js | Yes | External hosting |
| Python | Yes | External hosting |
| Node.js backend | Yes | External hosting |
## Syncing Changes
Once your project is connected to GitLab (either by pushing or importing), syncing is automatic.
### Automatic Push
OptiDev automatically pushes your changes to GitLab every time you save (commit). You don't need to do anything -- every change appears on GitLab within seconds.
### Pulling Updates
If there are new changes to your GitLab repository, you can pull them into OptiDev.
1. Open your project
2. Click the **GitLab** button
3. Click **Pull**
4. Changes from GitLab are merged into your project
If you have unsaved changes in OptiDev, commit them first to avoid conflicts.
### Viewing Your Commits
* On **GitLab**: Go to your repository and click "Commits"
* In **OptiDev**: Open your project and click on the icon (Version History)
## Group Access
GitLab uses groups (and subgroups) to organize repositories. When you connect your GitLab account, OptiDev automatically detects any groups where you have Developer access or higher.
To push a project to a group repository:
1. Click the **GitLab** button in your project
2. Select your GitLab account
3. Under owner, choose the group instead of your personal account
4. Continue with creating or selecting a repository
If you don't see a group listed, check that your GitLab account has at least Developer access to that group.
## Disconnecting
### Unlink a Project
1. Open your project
2. Click the **GitLab** button
3. Click **Disconnect**
Your project stays in OptiDev, but changes no longer sync to GitLab.
### Remove GitLab Account
1. Go to **Settings** -> **GitLab**
2. Find the account to remove
3. Click the trash icon
4. Confirm removal
All projects linked to that account are unlinked automatically.
## GitHub vs GitLab
Each project can be connected to either GitHub or GitLab, but not both at the same time. If your project is connected to GitHub and you want to switch to GitLab, disconnect from GitHub first.
## Troubleshooting
### "Permission denied" when pushing
Your GitLab token may have expired. Go to Settings -> GitLab, remove the connection, and reconnect.
### Changes not appearing on GitLab
Check that GitLab sync is enabled:
1. Open your project
2. Click the **GitLab** button
3. Ensure the connection is active
### Can't see group repositories
Make sure your GitLab account has at least Developer access to the group. OptiDev only lists groups where you can create and push to repositories.
### Import shows errors but project works
Some warnings during import are normal (like missing optional configs). If your project runs correctly, you can ignore them.
# Image Generation
Source: https://docs.optidev.ai/features/image-generation
Create images with AI for your app
## Generating Images with AI
Need an image for your app? Just ask the agent to create one. Describe what you want, and AI generates it for you.
**Example requests:**
* "Create a hero image of a modern office with plants"
* "Generate an icon of a shopping cart, flat design, blue"
* "Make a background pattern with geometric shapes"
## How to Generate an Image
1. Open your project and go to Agent Mode
2. Describe the image you want
3. Optionally specify the size (see below)
4. Wait a few seconds for generation
5. The image appears in your project's `public/` folder
**Example conversation:**
> **You:** Create a banner image for a coffee shop website, warm colors, cozy atmosphere
>
> **Agent:** I'll generate that image for you. What size would you like? The default is 16:9 (widescreen).
>
> **You:** Square is fine
>
> **Agent:** Done! I've created the image and saved it to `/public/coffee-banner.png`. Want me to add it to your homepage?
## Choosing Size and Style
### Available Sizes
| Aspect Ratio | Best For |
| ------------ | ----------------------------------- |
| 1:1 (Square) | Profile pictures, icons, thumbnails |
| 16:9 | Hero banners, video thumbnails |
| 4:3 | Standard photos, cards |
| 3:2 | Landscape photos |
| 9:16 | Mobile screens, stories |
| 2:3 | Portrait photos |
| 21:9 | Ultra-wide banners |
| 3:1 | Website headers |
| 1:3 | Vertical banners |
| 4:5 | Social media posts |
### Style Tips
Be specific about style in your prompt:
* **"Flat design"** — Simple, minimal, modern
* **"Realistic photo"** — Photographic quality
* **"Illustration"** — Hand-drawn or artistic style
* **"Minimalist"** — Clean with lots of white space
* **"3D render"** — Three-dimensional objects
## Where Images Are Saved
Generated images automatically save to your project's `public/` folder. The filename is based on your prompt, with automatic numbering if a similar file exists.
**Example:** `coffee-banner.png`, `coffee-banner-2.png`
You can find your images in:
* Code Editor → `public/` folder
* Or ask the agent: "Show me the images in my project"
## Using Generated Images
After generation, ask the agent to add the image to your app:
* "Add this image as the hero banner on the homepage"
* "Use this as the background for the contact section"
* "Replace the current logo with this image"
# Publish to OptiSigns Screens
Source: https://docs.optidev.ai/features/publish-to-optisigns
Display your app on digital signage screens
You'll need an Admin role in your workspace to publish to OptiSigns. If you're a member of an invited workspace, ask your workspace admin to grant you admin access.
## What is OptiSigns Integration?
OptiSigns is a digital signage platform that powers screens in offices, stores, restaurants, and public spaces. With OptiDev's integration, you can build an app and display it directly on any OptiSigns-connected screen.
**Perfect for:**
* Office dashboards showing KPIs and metrics
* Retail displays with promotions and product info
* Restaurant menus that update in real-time
* Lobby directories and wayfinding
* Kiosk applications for self-service
## How to Publish
### Prerequisites
* An OptiSigns account with screens set up
* A published OptiDev app (the system will prompt you to publish if needed)
### Step-by-Step
In your project editor, click the **Published** button in the top toolbar, then select **Publish to OptiSigns** from the dropdown.
If your app isn't published yet, you'll be prompted to publish first. Choose your visibility setting and click **Publish**. The OptiSigns flow continues automatically once deployment completes.
On first use, you'll need to generate a workspace API key. Click **Generate Key** to create your secure key.
Once generated, the key is displayed. You can copy it if needed for other integrations. Click **Continue to OptiSigns** to proceed.
You only need to generate this key once per workspace. Future publishes will skip this step.
The OptiSigns picker opens with three steps: **Select**, **Build**, and **Assign**.
* Choose your team from the dropdown
* Select a folder to save your app as an asset
* Click **Continue** to proceed
In the **Build** step, configure how your app appears in OptiSigns:
* **Name** - Give your app a recognizable name
* **Preview** - See how your app looks in landscape or portrait mode
* Click **Assign to Screens** to continue, or **Save** to assign later
In the **Assign** step, select which screens display your app:
* **Target** - Choose to assign to screens or screen groups
* **Screens** - Select the specific screens
* Click **Assign** to push your app to screens, or **Assign Later** to do this from the OptiSigns dashboard
Your app is now saved as an asset in OptiSigns and assigned to your selected screens. The app will appear on the screens within seconds.
# Publish Your App
Source: https://docs.optidev.ai/features/publish-your-app
Make your app live for anyone to visit
## How Publishing Works
When you publish your app, OptiDev:
1. Builds your project (compiles all the code)
2. Uploads it to our global network
3. Gives you a live URL anyone can visit
Your app gets a free URL like `yourproject.dev.optidev.com`. You can also [use your own domain](/features/custom-domain).
## Publishing Your App
### From the Dashboard
1. Open your project in OptiDev
2. Click the **Publish** button in the top-right corner
3. Wait for the build to complete (usually 1-2 minutes)
4. Your live URL appears when ready
### Using Agent Mode
Just ask the agent:
> "Publish my app"
The agent handles the build and deploy process for you.
## What Happens During Publishing
### Build Phase
OptiDev compiles your code into optimized files:
* Bundles JavaScript for faster loading
* Optimizes images
* Minifies code (makes files smaller)
You'll see a progress indicator. If there are errors, they'll appear with instructions to fix them.
### Deploy Phase
After a successful build:
* Files upload to CloudFlare's global network
* Your app becomes available worldwide
* SSL certificate ensures secure connections (https)
## Checking Deploy Status
### View Recent Deploys
1. Open your project
2. Click **Settings** → **Deploys**
3. See a list of all deployments with status and date
### Deploy Statuses
| Status | Meaning |
| ------------- | ---------------------------------------- |
| **Building** | Code is being compiled |
| **Deploying** | Files are being uploaded |
| **Live** | Your app is published and accessible |
| **Failed** | Something went wrong (see error message) |
## Fixing Build Errors
If publishing fails, you'll see an error message. Common issues:
**"Build failed"**
* Ask the agent: "The build failed, can you fix it?"
* The agent reviews the error and makes corrections
**"Missing dependencies"**
* Usually means a package wasn't installed correctly
* Ask the agent: "Install missing dependencies and try again"
## Rollback to Previous Version
Made a mistake? You can go back to an earlier version:
1. Go to **Settings** → **Deploys**
2. Find the version you want to restore
3. Click **Rollback**
4. Confirm the rollback
Your app immediately reverts to that version.
## Preview Before Publishing
Want to test before going live? Your project has a live preview while you're editing. The preview URL is only accessible to you.
Once you're happy with the preview, publish to make it public.
# Visual Editor
Source: https://docs.optidev.ai/features/visual-editor
Point-and-click editing for your app's design
## What is Visual Editor?
Visual Editor lets you edit your app's appearance by clicking on elements directly—no coding required. Want to change a headline? Click it and type. Need a different color? Select the element and pick from the color palette.
It's like editing a document, but for your app.
## Selecting and Editing Elements
### How to Select
1. Open your project in OptiDev
2. Click the **Visual Editor** tab above your app preview
3. Click any element on your page (text, buttons, images, etc.)
4. A blue outline appears showing what's selected
### What You Can Edit
Once you select an element, the sidebar shows options you can change:
* **Text content** — Click and type to change words
* **Colors** — Background, text color, borders
* **Size** — Width, height, padding, margins
* **Position** — Move elements around the page
* **Visibility** — Show or hide elements
## Common Tasks
### Change Text
1. Click on any text element
2. The text becomes editable
3. Type your new content
4. Click outside to save
### Change Colors
1. Select an element
2. In the sidebar, find **Background** or **Text Color**
3. Click the color swatch
4. Pick a new color or enter a hex code
### Adjust Spacing
1. Select an element
2. Look for **Padding** (space inside) or **Margin** (space outside)
3. Drag the sliders or enter specific values
### Rearrange Elements
1. Select an element
2. Drag it to a new position
3. Drop it where you want
## Working with Agent Mode
Visual Editor and Agent Mode work together. If you can't find an option in Visual Editor, just ask the agent:
* "Move this section above the header"
* "Make all buttons rounded"
* "Add a shadow to this card"
The agent makes the code changes, and you see the results in Visual Editor.
## Limitations
Some changes are easier to make through Agent Mode:
* Adding new sections or components
* Complex layouts with multiple columns
* Interactive features (forms, popups, animations)
* Changes that affect multiple pages at once
When in doubt, describe what you want to the agent—it'll figure out the best approach.
# Prompt Guide
Source: https://docs.optidev.ai/get-started/prompt-guide
Best practices for working with OptiDev Agent to build better apps
## Make a Plan
5-10 minutes of planning saves hours of work and produces better results.
### Give Context About Yourself
Include who you are, your organization, and your end goal:
> *"I'm a Growth Analyst for a SaaS company. I need to build a Stripe Dashboard showing recent subscriptions and new trial signups."*
This helps the agent understand your perspective and make better decisions.
### Use Modifiers to Shape Output
Instead of basic instructions, add modifiers that encourage quality:
> *"Create an analytics dashboard"*
> *"Create an analytics dashboard. Include as many relevant features and interactions as possible. Go beyond the basics to create a fully-featured implementation."*
### Describe Business Outcomes
Focus on what you want to achieve, not technical details:
> *"For the kiosk app:*
>
> * *If idle for 60 seconds, return to the attract screen*
> * *Users can swipe left/right to view different slides*
> * *Tap anywhere to go to product details"*
### Review the Plan
The agent creates a plan before building. Take time to review it and request changes before approving.
***
## Building Frontend
### A Picture is Worth a Thousand Words
Attach visual references to help the agent understand what you want:
* **Screenshots** of websites or apps you like
* **Figma designs** copied as images
* **URLs** to reference sites
> *"Scan this website and document the brand guidelines - colors, fonts, spacing. Use these throughout the app."*
### Use the Visual Editor
For quick design tweaks, the Visual Editor is often faster than prompting:
* Click elements to edit text directly
* Change colors and fonts without code
* Adjust spacing and layout visually
Use the Visual Editor for small changes. For bigger features, describe them to the Agent.
### Request Features Explicitly
Animations and interactive elements won't appear unless you ask:
> *"Add a smooth fade-in animation when the page loads. Make the buttons scale up slightly on hover."*
### Reference Component Libraries
Your project includes [shadcn/ui components](https://ui.shadcn.com/docs/components). Reference them by name:
> *"Use the Card component to display product info with image, title, and price."*
> *"Add a Dialog for the confirmation popup."*
***
## Working with Files
### Attach Reference Files
Upload PDFs, images, or documents for the agent to read and understand:
> *"Read the attached brand guidelines PDF and follow these standards."*
### Use Images in Your App
Attach images and tell the agent where to use them:
> *"Use this image as the hero background on the homepage."*
### Add Downloadable Files
For files users can download:
1. Activate **OptiDev Cloud**
2. Go to **Storage** and upload your files
3. Tell the agent:
> *"Add a Download section. When users click the button, download `my_document.pdf` from OptiDev Cloud Storage."*
***
## OptiDev Cloud & Backend
If you need database access, API integrations, or user authentication:
1. **Activate OptiDev Cloud first** before asking the agent to build backend features
2. **Add API keys to Secrets** in your project's OptiDev Cloud settings
3. **Tell the agent** which secrets are available
> *"My Stripe API key is stored in OptiDev Cloud Secrets as `STRIPE_SECRET_KEY`. Use it to fetch subscription data."*
***
## Working with API Keys
### Be Explicit About Available Keys
AI agents are cautious around credentials by design. Always tell the agent explicitly:
> *"The Stripe API key is available in OptiDev Cloud Secrets. You can use it safely."*
### Start with Least Privilege
Always use the most restricted keys possible:
* Read-only keys for dashboards and data displays
* Limited-scope keys for specific operations
* Never use admin or full-access keys unless absolutely necessary
### Provide Documentation
Help the agent find the right API patterns:
> *"Search for the latest Stripe API documentation for listing subscriptions."*
Or paste direct links:
> *"Use this API reference: [https://stripe.com/docs/api/subscriptions/list](https://stripe.com/docs/api/subscriptions/list)"*
Many APIs like Stripe and Shopify offer "Copy as Markdown" or `llms.txt` files. These are excellent for giving the agent accurate context.
### Give Example Data
You know your business better than the agent. Provide examples:
> *"Here's a sample API response from our system. Notice we only want to display subscriptions where `status` is 'active' and `product_id` starts with 'prod\_premium'."*
You can even attach CSV or JSON files with sample data for analysis.
***
## Session Management
### Starting New Sessions
As your project grows, starting fresh sessions can help:
> *"Read through the project to understand the current state. I want to add a new feature for user notifications."*
This gives the agent context without carrying over confusion from previous work.
### Context Windows
Long sessions can lose focus. If the agent seems confused or repetitive, start a new session with clear instructions about where you left off.
***
## Self Documentation
Good documentation becomes more valuable than the code over time.
### Keep a Changelog
After significant changes:
> *"Update CHANGELOG.md with the features we just added."*
### Maintain Project Notes
Ask the agent to document architecture decisions:
> *"Update CLAUDE.md with notes about the authentication flow we implemented."*
**Guidelines for CLAUDE.md:**
* Keep under 250 lines (ideally 150 or less)
* 2-3 sentence high-level intro focused on business purpose
* ASCII diagrams for critical architecture
* File/folder structure with one-line explanations
* No future plans or philosophy - just current state
***
## Models
**Claude Sonnet 5** is the default and the best all-rounder — start there. Switch when a task is too hard for it, too small to spend much on, or your project has grown large.
A good workflow: plan on a strong model like Sonnet 5 or Opus, then switch to Claude 4.5 Haiku to build a plan that's already clear.
See [Choosing a Model](/features/choosing-a-model) for every model available, which plan unlocks it, and how model choice affects your credits.
***
## Debugging
### Attach Screenshots
When something isn't working, show the agent what you see:
> *"Here's a screenshot of the error. The button click isn't working."*
### Start Simple
For easy issues, just ask the agent to fix it. For complex problems:
> *"Analyze this issue deeper. Look at the related files and come up with a plan to fix it. Don't make changes yet."*
### Verify Before Fixing
If the agent's first attempts don't work:
> *"Before making more changes, confirm this is the real fix and not a workaround. Show me evidence from the code."*
This forces deeper analysis and better solutions.
***
## Stopping and Starting Over
### Don't Be Afraid to Stop
Click **Stop** anytime - even mid-task - to:
* Give clarification
* Change direction
* Ask questions about what it's doing
### When to Start Fresh
**Build a new app** when:
* You're only a few steps in and things aren't going well
* Your original prompt was unclear
* A few word changes could produce better results
**Start a new session** when:
* The agent isn't making progress on a bug
* Responses seem confused or repetitive
* You want to approach a problem differently
***
## Final Words
Consider this parable:
> A man riding a horse. Someone asks: "Where are you going?"
>
> The man replies: "I don't know, ask the horse."
The agent is the horse. You are the rider. **Stay in control.**
* Review plans before approving
* Stop and redirect when needed
* Provide clear context and goals
* Trust your judgment about your business
The best apps come from clear direction and thoughtful collaboration.
# Quickstart
Source: https://docs.optidev.ai/get-started/quickstart
Build and publish your first web app in minutes with AI
## What is OptiDev?
OptiDev is an AI-powered platform that turns your ideas into fully functional web applications. Describe what you want, and watch it come to life.
**No coding experience? No problem.** If you can describe it, you can build it.
***
## Step 1: Start with a Plan
Go to [app.optidev.ai/dashboard](https://app.optidev.ai/dashboard) and click **Create New App**.
Give OptiDev Agent context about who you are and what you're building:
> *"I'm a Marketing Coordinator for a Harley Davidson dealer in Texas. I need to create a kiosk page for our touchscreen display on the showroom floor. We're highlighting the Pan America 1250 ST model this month."*
> *"I'm a Growth Analyst for a SaaS company. I need to build a Stripe Dashboard showing recent subscriptions and new trial signups."*
The more context you provide, the better your app will be.
***
## Step 2: Attach Context
You can attach files and links to help OptiDev Agent understand exactly what you want:
| Attachment Type | How to Use |
| --------------- | ----------------------------------------------------------------------- |
| **Screenshots** | Paste images of websites, apps, or designs as reference |
| **Documents** | Attach PDFs or docs with product info, brand guidelines, etc. |
| **URLs** | Paste website links and ask the agent to use them as reference |
| **Images** | Attach photos to include in your app, or ask the agent to generate them |
### Example with Attachments
> *"I want the kiosk to have an attract screen that slides through these 3 images. \[attach images]*
>
> *Read this URL [https://www.harley-davidson.com/us/en/motorcycles/pan-america-1250-st.html](https://www.harley-davidson.com/us/en/motorcycles/pan-america-1250-st.html) for product info and write a short description for each slide.*
>
> *When someone taps the screen, show a page explaining how to order with this month's special discount."*
Describe your app like you're telling a friend to build it for you.
***
## Step 3: Review and Build
OptiDev Agent creates a plan before building. This saves time by catching issues early.
### Review the Plan
* Read through what the agent proposes to build
* Ask for changes if something isn't right
* Approve when you're happy with the direction
### First Build
Click **Approve** and the agent starts building. First builds typically take **5-15 minutes** depending on complexity.
You'll see live progress as the agent writes code, creates components, and sets up your app.
Grab a coffee while your app is being built. The agent will let you know when it's ready for review.
***
## Step 4: Refine Your App
Once the first build is complete, refine it until it's exactly what you want.
### Give Feedback
* **Take a screenshot** of what you see and paste it into the chat
* Point out specific things: *"Make the header text larger"* or *"Change the CTA button to red"*
* Reference components by name: *"Update the hero section..."*
### Use the Visual Editor
For quick design tweaks, switch to the **Visual** tab:
* Click any element to select it
* Edit text directly on the page
* Change colors, fonts, and spacing without code
The Visual Editor is perfect for small changes. For bigger features, describe them to the Agent.
***
## Step 5: Publish and Share
When you're happy with your app, click **Publish** in the top right corner.
Your app builds and deploys in seconds. You'll get a public URL to share immediately.
### Connect Your Own Domain
Want to use your own domain like `app.yourcompany.com`?
See [Custom Domain](/features/custom-domain) for setup instructions.
***
## What's Next?
Learn how to write effective prompts for better results.
Deep dive into Claude AI assistant capabilities.
Master the point-and-click visual editing tools.
Add a database, user auth, and APIs to your app.
# Advisors
Source: https://docs.optidev.ai/optidev-cloud/advisors
Check your database for security vulnerabilities and performance issues
## What are Advisors
Advisors automatically scan your OptiDev Cloud database to find potential problems before they become critical issues. Think of them as a health check for your database - catching mistakes early and suggesting improvements.
***
## Opening the Advisors Tab
1. Go to your project in OptiDev
2. Open **OptiDev Cloud**
3. Click the **Advisors** tab
### Security vs Performance
Use the dropdown at the top-left to switch between:
* **Security** - Access control, authentication, data protection issues
* **Performance** - Slow queries, missing indexes, inefficient configurations
***
## Understanding the Results
### Severity Levels
Issues are grouped by severity:
* **Errors** (red flag) - Critical issues you should fix immediately
* **Warnings** (yellow flag) - Problems that could cause issues soon
* **Info** (green flag) - Suggestions to improve your database
### Filtering by Severity
Click any severity card on the left to see only those issues:
* Click **Errors** to see critical security or performance problems
* Click **Warnings** to review potential issues
* Click **Info** to see optimization suggestions
By default, errors are shown first since they need immediate attention.
***
## Common Security Issues
### Missing Row Level Security (RLS)
**What it means:**
Your tables don't have Row Level Security enabled. This means any user with database access can read or modify all rows.
**Why it matters:**
Without RLS, users can see other users' data. For example, a customer could see orders from other customers.
**How to fix:**
OptiDev Agent can enable RLS for you:
> *"Enable Row Level Security on the orders table so users can only see their own orders"*
### RLS Disabled on Public Tables
**What it means:**
Tables in your `public` schema don't have RLS policies.
**Why it matters:**
Public tables are accessible by default. Without RLS policies, anyone can query all data.
**How to fix:**
Click the **Copy SQL** button to get the command, or ask OptiDev Agent:
> *"Add RLS policy to the users table to restrict access by user\_id"*
### Insecure View Configurations
**What it means:**
Database views without `security_invoker=on` don't respect Row Level Security.
**Why it matters:**
Views might expose data that should be protected by RLS policies.
**How to fix:**
Recreate the view with the security setting enabled. Copy the remediation SQL from the issue details.
***
## Common Performance Issues
### Unindexed Foreign Keys
**What it means:**
Foreign key columns don't have indexes. This makes queries that join tables very slow.
**Example:**
If `orders.customer_id` references `customers.id`, but there's no index on `customer_id`, looking up a customer's orders is slow.
**How to fix:**
Click the **Copy SQL** button to get the CREATE INDEX command, or tell OptiDev Agent:
> *"Add an index to the customer\_id column in the orders table"*
### Inefficient RLS Policies
**What it means:**
Your Row Level Security policies are poorly written and slow down every query.
**Why it matters:**
Bad RLS policies can make your entire app slow since they run on every database access.
**How to fix:**
Review the policy details and optimize the conditions. Ask OptiDev Agent for help:
> *"Optimize the RLS policy on the orders table for better performance"*
### Duplicate Indexes
**What it means:**
You have multiple indexes that serve the same purpose.
**Why it matters:**
Extra indexes waste storage space and slow down INSERT/UPDATE operations.
**How to fix:**
Copy the DROP INDEX command from the remediation section to remove the duplicate index.
***
## How Often to Check Advisors
Check advisors:
* **After creating new tables** - Make sure you didn't miss indexes or security
* **Weekly for active projects** - Catch issues as your database evolves
* **Before going live** - Verify everything is secure and optimized
***
## Why This Matters
### Security Issues Can Lead To:
* Data breaches (users seeing each other's data)
* Compliance violations (GDPR, HIPAA)
* Reputation damage
### Performance Issues Can Lead To:
* Slow app response times
* Database crashes under load
* High infrastructure costs
Fixing these issues early saves time and money.
***
## Reading Issue Details
Click any issue to expand and see:
* **Title** - What the issue is
* **Description** - Why it's a problem
* **Details** - Specific information about the issue
* **Affected Object** - The database object involved (schema, table, view, or function name)
* **Remediation** - Instructions or commands to fix the issue (click **Copy** to copy the link)
***
## Refreshing the Scan
Click **Refresh** in the top-right to re-scan your database after making changes. This helps verify that:
* Fixed issues no longer appear
* New changes haven't introduced new issues
* Your optimizations are working
***
## Fixing Issues with the Agent
The OptiDev Agent can automatically fix most advisor issues for you.
### Using the "Fix with Agent" Button
Each issue has a **Fix with Agent** button. Click it to:
1. Preview the prompt that will be sent to the agent
2. Review the issue details and remediation SQL
3. Click **Send to Agent** to redirect to the agent chat
4. The agent applies the fix to your database
If the agent is currently processing another request, the button will show **Agent Busy** and be disabled. Wait for the current task to complete before sending a new fix request.
### Manually Asking the Agent
You can also copy the issue title and ask the agent directly:
```
Fix the advisor issue: [paste issue title here]
```
For example:
```
Fix the advisor issue: Unindexed foreign keys on orders.customer_id
```
***
## Publish Warning
When you have unresolved advisor issues, a warning appears in the **Publish** dropdown:
* Shows the count of errors, warnings, and info issues
* Reminds you to review issues before publishing
This helps ensure you don't accidentally deploy with critical security or performance problems.
***
## Tips and Best Practices
### Fix Errors First
Always address red flag errors before warnings. Security vulnerabilities should be your top priority.
### Test Fixes in Development
If you're not sure about a fix, test it in a development project first before applying it to production.
### Document Changes
When OptiDev Agent fixes issues, review what it changed so you understand the security model and performance characteristics.
### Regular Monitoring
Make checking advisors part of your deployment process. Add a reminder to check after major database changes.
***
## For Developers
### API Endpoints
Advisors use the Supabase Management API:
* `GET /v1/projects/{ref}/advisors/security` - Security lints
* `GET /v1/projects/{ref}/advisors/performance` - Performance lints
### Lint Response Format
```json theme={null}
{
"lints": [
{
"name": "unindexed_foreign_keys",
"title": "Unindexed Foreign Keys",
"level": "ERROR",
"categories": ["PERFORMANCE"],
"description": "Foreign key columns should be indexed",
"detail": "orders.customer_id references customers.id",
"remediation": "CREATE INDEX idx_orders_customer_id ON orders(customer_id);",
"metadata": {
"schema": "public",
"name": "orders",
"type": "table"
}
}
]
}
```
### Severity Levels
* `ERROR` - Critical issues requiring immediate action
* `WARN` - Problems that should be addressed soon
* `INFO` - Suggestions for improvement
### Categories
* `SECURITY` - Access control, authentication, data protection
* `PERFORMANCE` - Query speed, indexes, configuration
### Filtering
Results can be filtered by:
* **Advisor type** (security vs performance)
* **Severity level** (ERROR, WARN, INFO)
### Claude Agent Integration
OptiDev Agent has access to Advisors via MCP tools and can automatically fix issues using the remediation SQL provided in each lint.
# Authentication
Source: https://docs.optidev.ai/optidev-cloud/auth
Configure sign-in methods and manage users for your app
## What is Auth
Auth (authentication) lets users create accounts and log into your app. OptiDev Cloud handles all the complex parts:
* **Account creation** - Users can sign up with email, phone, or Google
* **Secure login** - Password hashing, session management, all handled for you
* **Password reset** - Automatic "forgot password" emails
* **User management** - See all your users and their account details
You don't need to build any of this from scratch - just tell OptiDev Agent what you need.
***
## Adding Login with OptiDev Agent
### Example: Basic Email Login
> *"Add user login to my app with email and password"*
OptiDev Agent will:
1. Enable email authentication
2. Create sign-up and login forms
3. Add logout functionality
4. Show different content for logged-in vs logged-out users
### Example: Google Sign-In
> *"Let users sign in with their Google account"*
OptiDev Agent will set up Google OAuth, add a "Sign in with Google" button, and handle the flow.
### Example: Phone Login
> *"Add phone number login with SMS verification codes"*
OptiDev Agent will enable phone authentication, create a phone-number form, and handle SMS code verification.
***
## Sign-In Methods
OptiDev Cloud supports three sign-in methods. Each one has its own row at the top of the Authentication tab — click a row to expand its settings.
| Method | Best for |
| -------------------- | --------------------------------------------------------------- |
| **Email & password** | Most apps; enabled by default |
| **Phone (SMS)** | Mobile-first apps; users who prefer not to manage passwords |
| **Google** | Quick onboarding; users who'd rather not create another account |
***
## Email Settings
Click **Email** to expand the settings panel. The main controls:
* **Enable email sign-in** — Master toggle for this method.
* **Confirm email** — When on, users must click a link in their email before they can use your app. Recommended.
* **Secure email change** — Requires re-authentication before a user can change their email.
* **Secure password change** — Requires re-authentication before a user can change their password.
* **Prevent leaked passwords** — Checks passwords against the HaveIBeenPwned database and blocks ones that have appeared in known breaches.
* **Minimum password length** — Between 6 and 72 characters (default 6).
* **Password requirements** — None, letters + digits, mixed case + digits, or mixed case + digits + symbols.
* **OTP expiration** and **OTP length** — Controls one-time codes used for magic links and password resets.
***
## Phone Settings
Click **Phone** to expand. OptiDev Cloud sends SMS verification codes through a provider of your choice.
### SMS Provider
Pick one from the dropdown:
* **Twilio** — needs Account SID, Auth Token, Message Service SID
* **Twilio Verify** — needs Account SID, Auth Token, Verify Service SID (optional Content SID for WhatsApp)
* **MessageBird** — needs Access Key and Originator
* **Textlocal** — needs API Key and Sender
* **Vonage** — needs API Key, API Secret, and From number
You'll need an account with one of these providers before phone login will work. OptiDev Agent can help wire up the credentials:
> *"Set up phone authentication using Twilio"*
### Other phone controls
* **Phone confirmations** — Require users to verify their phone before signing in.
* **SMS OTP expiry** and **OTP length** — Tune how long codes are valid and how many digits they have.
* **SMS template** — Customize the message body; use `{{ .Code }}` as the placeholder for the verification code.
* **Test phone numbers** — Pre-set `phone=otp` pairs for testing without sending real SMS.
***
## Google Settings
Click **Google** to expand. To enable Google sign-in you need OAuth credentials from Google Cloud Console.
* **Client ID(s)** — Comma-separated. You can list multiple IDs here for Web OAuth, Android, One Tap, and Chrome extensions all at once.
* **Client Secret** — From your Google Cloud OAuth client.
* **Skip nonce checks** — Leave off unless you have a specific reason; nonce checks protect against replay attacks.
* **Callback URL** — Read-only field shown in the panel. Copy this and paste it into your Google OAuth client's "Authorized redirect URIs" list.
***
## General Settings
Below the sign-in methods, three toggles control who can join your app:
* **Allow new signups** — When off, only existing users can log in. Good for invite-only apps.
* **Anonymous sign-in** — Lets people use your app without creating an account. They can convert to a full account later by adding an email or phone.
* **Require email confirmation** — A general version of the per-provider email confirmation toggle above.
***
## Advanced Settings
Click **Advanced** at the bottom of the configuration section to expose:
### Site URL
The main URL of your app. Used in email templates for links back to your app (e.g. password-reset links).
### Redirect URLs
A list of URLs users may be redirected to after logging in. Each entry is automatically suffixed with `/**` so any path under that domain is allowed. URLs must use `https://`. Only add domains you control.
***
## Custom SMTP
By default, OptiDev Cloud sends auth emails (invitations, magic links, password resets) through a built-in service capped at **2 emails per hour**. To send more — and from your own branded address — connect your own email provider with **Custom SMTP**.
**You need a domain you own.** Auth emails must be sent from an address on a domain you control (e.g. `noreply@yourcompany.com`). You can't send from your app's default `.optiedge.cc` URL, because you don't control its DNS. If you don't have a domain, the built-in sender (2/hour) is your only option.
### Setting it up (example: Resend)
1. **Verify your domain** with your email provider. In [Resend](https://resend.com), add your domain — it will show you a few **DNS records** to copy into your domain's DNS settings (wherever your domain is registered). Once added, Resend marks the domain **Verified**, usually within a few minutes.
2. **Create an API key** in the provider.
3. In the **Authentication** tab, scroll to **Custom SMTP**, turn on **Enable custom SMTP**, and fill in:
| Field | Value (Resend) |
| ------------------------- | ----------------------------------------------------------------- |
| Host | `smtp.resend.com` |
| Port | `465` |
| Username | `resend` |
| Password | your API key |
| Sender email (From) | `noreply@yourdomain.com` — must be on your **verified** domain |
| Sender name | Your app or company name |
| Emails per hour | Raise above the built-in 2 (e.g. 100) |
| Minimum interval per user | Seconds before another email can go to the same user (default 60) |
4. Click **Save changes**, then send a test invite. Emails now come from your domain.
The **Sender email must match the domain you verified** with your provider. A mismatch — for example sending from `noreply@send.yourdomain.com` when only `yourdomain.com` is verified — is rejected with a "domain is not verified" error.
Other providers (SendGrid, Amazon SES, Mailgun, Postmark) work the same way — only the **Host** and **Username** differ. To turn it off, toggle **Enable custom SMTP** off; auth emails revert to the built-in sender.
***
## Managing Users
The right side of the Authentication tab shows everyone who has signed up.
* **Create** a user manually (email + password, optional phone).
* **Invite** a user by email so they pick their own password.
* Click the `…` menu on any user row to send them a **Magic link** (passwordless sign-in email) or **Delete** their account.
* Click a row to see full details (UUID, last sign-in, verification timestamps, enabled login methods).
* Search by email, phone, or user ID. List shows 10 per page.
**Email rate limit:** the built-in email service is capped at **2 emails per hour** (invitations, magic links, password resets). To send more — and from your own branded address — set up [Custom SMTP](#custom-smtp).
***
## Security Best Practices
* **Require email confirmation** to verify real addresses and reduce fake accounts.
* **Keep sign-in options simple.** Pick one or two methods that fit your audience instead of enabling everything.
* **Use Row Level Security** to make sure users can only access their own data:
> *"Make sure users can only see their own orders"*
OptiDev Agent will set up the right policies for you.
***
## For Developers
### Supabase Auth Client
```typescript theme={null}
// Check who's logged in
const { data: { user } } = await supabase.auth.getUser()
// Sign up
await supabase.auth.signUp({ email, password })
// Sign in
await supabase.auth.signInWithPassword({ email, password })
// Sign in with Google
await supabase.auth.signInWithOAuth({ provider: 'google' })
// Sign out
await supabase.auth.signOut()
// React to auth changes
supabase.auth.onAuthStateChange((event, session) => {
// event: 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | ...
})
```
### Row Level Security
```sql theme={null}
-- Users can only see their own orders
CREATE POLICY "Users see own orders" ON orders
FOR SELECT USING (auth.uid() = user_id);
```
### User management API
```http theme={null}
GET /api/supabase/projects/:projectId/auth/users?page=1&perPage=10
POST /api/supabase/projects/:projectId/auth/users
POST /api/supabase/projects/:projectId/auth/users/invite
DELETE /api/supabase/projects/:projectId/auth/users/:userId
```
All endpoints require a Firebase Bearer token.
### User object shape
```typescript theme={null}
interface User {
id: string; // UUID
email?: string;
phone?: string;
created_at: string; // ISO 8601
updated_at: string;
last_sign_in_at?: string;
email_confirmed_at?: string;
phone_confirmed_at?: string;
invited_at?: string;
app_metadata: { provider: string }; // 'email' | 'phone' | 'google'
user_metadata: Record; // Custom fields
}
```
### Admin SDK
OptiDev Cloud calls the Supabase JS admin client under the hood:
```typescript theme={null}
await supabase.auth.admin.listUsers({ page: 1, perPage: 10 })
await supabase.auth.admin.createUser({ email, password, email_confirm: true })
await supabase.auth.admin.deleteUser(userId)
await supabase.auth.admin.inviteUserByEmail(email, { redirectTo })
```
### Rate limits
* User listing / creation / deletion: \~60-100 requests per minute
* **Email sending: 2 per hour** on the built-in service (invites, magic links, password resets). [Custom SMTP](#custom-smtp) lifts this — set your own **Emails per hour**.
# Connection Info
Source: https://docs.optidev.ai/optidev-cloud/connection-info
Access your API credentials and database connection strings
## What is Connection Info
The Connection Info tab shows your OptiDev Cloud API credentials and database connection details. These values are used to connect your app to your backend services.
***
## API Credentials
### API URL
The secure gateway URL for your OptiDev Cloud backend. This is used to make API calls to your database, authentication, storage, and edge functions. All requests are routed through OptiDev's secure gateway with automatic session management and HMAC authentication.
**Example:** `https://a1b2c3d4e5f6g7h8i9j0.sb.optidev.ai`
The API URL uses an encrypted identifier for enhanced security. Your app connects through this gateway, which securely proxies requests to the backend services.
### Publishable Key
Your public API key that's safe to use in your app's frontend code. This key has limited permissions and can be exposed in client-side code.
**Example:** `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`
### Copying Credentials
Click the copy icon next to any value to copy it to your clipboard. These values are automatically added to your project's `.env.local` file when you activate OptiDev Cloud.
***
## Database Connection
Click the **Connect** button to access your PostgreSQL connection details for use with database clients, ORMs, and other tools.
### Connection String Formats
When you click **Connect**, you'll see a modal with connection strings in 9 different formats:
**1. URI**
Standard PostgreSQL connection string format:
```
postgresql://postgres:[password]@[host]:5432/postgres
```
**2. PSQL**
Command-line psql format:
```bash theme={null}
psql -h [host] -p 5432 -d postgres -U postgres
```
**3. Golang**
Go database/sql format:
```go theme={null}
host=[host] port=5432 user=postgres password=[password] dbname=postgres
```
**4. JDBC**
Java JDBC format:
```
jdbc:postgresql://[host]:5432/postgres?user=postgres&password=[password]
```
**5. .NET**
C# Npgsql format:
```
Host=[host];Port=5432;Database=postgres;Username=postgres;Password=[password]
```
**6. Node.js**
JavaScript pg client format:
```javascript theme={null}
{
host: '[host]',
port: 5432,
database: 'postgres',
user: 'postgres',
password: '[password]'
}
```
**7. PHP**
PHP PDO format:
```php theme={null}
$dsn = "pgsql:host=[host];port=5432;dbname=postgres";
$username = "postgres";
$password = "[password]";
```
**8. Python**
Python psycopg2 format:
```python theme={null}
import psycopg2
conn = psycopg2.connect(
host="[host]",
port=5432,
database="postgres",
user="postgres",
password="[password]"
)
```
**9. SQLAlchemy**
Python ORM format:
```python theme={null}
postgresql://postgres:[password]@[host]:5432/postgres
```
### Security Note
The password is masked in the display (shown as `••••••••`) but copies correctly when you click the copy button. Select the format that matches your development tools.
### Session Pooler
OptiDev Cloud uses a session pooler on port 5432 for full PostgreSQL compatibility. This provides:
* Better connection management for high-traffic applications
* Support for all PostgreSQL features and extensions
* Compatibility with any PostgreSQL client or ORM
***
## Environment Variables
When you activate OptiDev Cloud, these environment variables are automatically added to your project:
### Frontend Variables
```bash theme={null}
VITE_SUPABASE_URL=https://[encrypted-id].sb.optidev.ai
VITE_SUPABASE_PUBLISHABLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
VITE_SUPABASE_GATEWAY_URL=https://[encrypted-id].sb.optidev.ai
```
These are safe to use in your frontend code and are included in your client-side bundle.
***
## Using Connection Info in Your App
### Frontend (React/Vue/etc)
```typescript theme={null}
import { createClient } from '@supabase/supabase-js'
const supabase = createClient(
import.meta.env.VITE_SUPABASE_URL,
import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
)
```
### Direct Database Access (Node.js)
```javascript theme={null}
import { Pool } from 'pg'
const pool = new Pool({
connectionString: process.env.SUPABASE_DB_URL
})
```
***
## For Developers
### API Key Types
**Publishable Key (anon key)**
* Limited to Row Level Security (RLS) policies
* Can be safely exposed in client-side code
* Used for frontend applications
* Rate-limited to prevent abuse
**Service Role Key**
* Bypasses Row Level Security (RLS) policies
* Has full admin access to your database
* Should only be used in secure backend environments
* Never expose in frontend code or public repositories
### Connection Pooling
OptiDev Cloud provides two connection modes:
**Session Pooler (Port 5432)**
* Full PostgreSQL compatibility
* Supports all PostgreSQL features
* Used for complex queries and transactions
* Recommended for most use cases
**Transaction Pooler (Port 6543)**
* Optimized for high-concurrency scenarios
* Limited to single-transaction queries
* Not suitable for prepared statements or session variables
### Connection Limits
Each OptiDev Cloud project has connection limits based on your plan:
* **Free tier:** 60 concurrent connections
* **Pro tier:** 200 concurrent connections
* **Enterprise:** Custom connection limits
Connection pooling helps maximize these limits by efficiently managing connections across your application.
### Security Best Practices
1. **Never commit credentials** to version control
2. **Use environment variables** for all sensitive data
3. **Rotate passwords regularly** for production databases
4. **Use service role key only in backend** code
5. **Enable Row Level Security** on all tables
6. **Monitor connection usage** to prevent exhaustion
# Database
Source: https://docs.optidev.ai/optidev-cloud/database
Store and manage your app's data with a managed PostgreSQL database
## What is the Database
The database is where your app stores all its information - user profiles, products, orders, messages, settings, and more. Think of it like a collection of spreadsheets, where each "table" holds a specific type of data.
OptiDev Cloud gives you a fully managed PostgreSQL database. This means:
* **No setup required** - Your database is ready as soon as you activate OptiDev Cloud
* **Automatic backups** - Your data is safely backed up
* **Fast and reliable** - Hosted on global infrastructure with high availability
***
## Creating Tables with OptiDev Agent
The easiest way to create tables is to describe what you need to OptiDev Agent.
### Example: Product Catalog
> *"Create a products table with name, description, price, category, and whether it's in stock"*
OptiDev Agent will create a table with the right columns and data types automatically.
### Example: Customer Orders
> *"I need to track orders. Each order has a customer email, list of items, total amount, shipping address, and order status"*
OptiDev Agent will:
1. Create the orders table
2. Set up appropriate column types (text for email, number for total, etc.)
3. Add a timestamp for when orders are created
### Example: Blog Posts
> *"Create tables for a blog with posts and comments. Posts have a title, content, author, and publish date. Comments belong to a post and have the commenter name and message"*
OptiDev Agent understands relationships between tables and will set them up correctly.
***
## Browsing Tables in the Dashboard
### Viewing Your Tables
1. Go to the **Database** tab in OptiDev Cloud
2. The left sidebar shows all your tables
3. Click any table name to instantly view its data (shows first 10 rows by default)
The SQL editor automatically populates with the query, so you can modify it and run again if needed.
### Understanding the Table View
After executing a query, you'll see the result:
* **Row count** - Shows how many rows were returned by your query
* **Columns** - The header row shows all fields in your table
* **Rows** - Each row is one record (one product, one order, one user, etc.)
### Navigating Large Tables
Use the pagination controls at the bottom:
* **Rows per page** - Choose to show 10, 25, 50, or 100 rows at a time
* **Page navigation** - Click arrows or page numbers to browse through data
* **Row counter** - Shows which rows you're viewing (e.g., "Showing 1-50 of 1,234")
***
## Editing Data
### Editing a Single Cell
1. **Double-click** any cell you want to edit
2. Type the new value
3. Press **Enter** to save, or **Escape** to cancel
The change is saved immediately to your database.
Cell editing requires your table to have an `id` column. Tables without an `id` column cannot be edited directly in the dashboard - use SQL queries instead.
### Adding a New Row
1. Click the **Add Row** button above the results
2. Fill in the values for each column
3. Click **Add Row** to save
### Selecting Multiple Rows
* Click the checkbox next to any row to select it
* Use the checkbox in the header to select all visible rows
* Selected rows can be exported or copied together
***
## Running SQL Queries
For more advanced data access, you can write SQL queries directly.
### The SQL Editor
Above the results table, you'll see a code editor. This is where you write SQL queries.
### Basic Queries
**View all data from a table:**
```sql theme={null}
SELECT * FROM products
```
**Find specific records:**
```sql theme={null}
SELECT * FROM orders WHERE status = 'pending'
```
**Search by date:**
```sql theme={null}
SELECT * FROM users WHERE created_at > '2024-01-01'
```
**Count records:**
```sql theme={null}
SELECT COUNT(*) FROM orders WHERE total > 100
```
### Running a Query
1. Type your SQL in the editor
2. Click **Execute Query** (or the play button)
3. Results appear in the table below
***
## Exporting Data
### Export Options
Click the **menu icon** (three dots) above the results to see export options:
* **Export to JSON** - For use in other applications or backups
* **Export to CSV** - Opens in Excel, Google Sheets, or any spreadsheet app
* **Export to XLSX** - Tab-separated format that opens in Excel
* **Copy as SQL** - Get INSERT statements to recreate the data elsewhere
### Exporting Selected Rows
1. Select rows using the checkboxes
2. Click the menu icon
3. Choose "Export selected to..." for your preferred format
This is useful when you only need a subset of your data.
***
## Managing Tables with OptiDev Agent
### Adding Columns
> *"Add a 'discount\_percent' column to the products table"*
### Modifying Data
> *"Update all orders from last month to have status 'archived'"*
### Creating Sample Data
> *"Add 10 sample products to the products table with realistic names and prices"*
### Analyzing Data
> *"Show me the top 10 customers by total order value"*
OptiDev Agent can write and run complex queries for you, then explain the results.
***
## Common Tasks
### Finding Records
**By exact match:**
```sql theme={null}
SELECT * FROM users WHERE email = 'john@example.com'
```
**By partial match:**
```sql theme={null}
SELECT * FROM products WHERE name LIKE '%shirt%'
```
**By multiple conditions:**
```sql theme={null}
SELECT * FROM orders WHERE status = 'shipped' AND total > 50
```
### Sorting Results
**Newest first:**
```sql theme={null}
SELECT * FROM orders ORDER BY created_at DESC
```
**Alphabetically:**
```sql theme={null}
SELECT * FROM products ORDER BY name ASC
```
### Limiting Results
**First 10 records:**
```sql theme={null}
SELECT * FROM products LIMIT 10
```
**Skip and limit (for pagination):**
```sql theme={null}
SELECT * FROM products LIMIT 10 OFFSET 20
```
***
## Tips and Best Practices
### Let OptiDev Agent Help
If you're not sure how to write a query, just ask:
> *"Show me all orders from the last 7 days sorted by total amount"*
OptiDev Agent will write the SQL and run it for you.
### Use the Table Browser
For quick data checks, just click table names in the sidebar. You don't need to write SQL for basic browsing.
### Export Before Major Changes
Before making big changes to your data, export a backup:
1. Run `SELECT * FROM table_name`
2. Export to JSON or CSV
3. Keep the file as a backup
***
## For Developers
### PostgreSQL Compatibility
OptiDev Cloud runs PostgreSQL, giving you access to:
* All standard SQL features
* JSON/JSONB columns for flexible data
* Full-text search
* Indexes for performance
### Connection String
Click **Connect** in the Connection Info tab to get your database connection string. Use it with:
* Database clients (TablePlus, DBeaver, pgAdmin)
* ORMs (Prisma, TypeORM, Drizzle)
* Direct PostgreSQL connections
The connection uses session pooler (port 5432) for full compatibility.
### Schema
Tables are created in the `public` schema by default. Use `information_schema` queries for metadata about your tables.
### Row Level Security
OptiDev Cloud supports Row Level Security (RLS) policies. Ask OptiDev Agent to set up policies like:
> *"Only let users see their own orders"*
# Edge Functions
Source: https://docs.optidev.ai/optidev-cloud/edge-functions
Run server-side code and store API keys for your app
## What are Edge Functions
Edge Functions are small pieces of code that run on the server instead of in the browser. Use them for anything you can't (or shouldn't) do client-side:
* **Payment processing** — Stripe, PayPal, etc.
* **Sending emails** — confirmations, notifications, newsletters
* **API integrations** — HubSpot, Zendesk, custom APIs
* **Protected operations** — anything that needs a secret API key
They run globally, close to your users, so they're fast everywhere.
***
## Creating Functions with OptiDev Agent
Describe what you need and OptiDev Agent writes the function, wires up any required services, and deploys it.
> *"Create an API endpoint that accepts credit card payments with Stripe and saves the order to the database"*
> *"Send a welcome email when a new user signs up"*
> *"Fetch customer data from HubSpot when given an email"*
***
## The Edge Functions Tab
Split into two panels: **Functions on the left**, **Secrets on the right** (stacked on mobile).
The function panel has two sections:
* **Workspace Functions** — code in your project files. Each row shows a **Live** badge (green) if deployed, or **Not deployed** (gray).
* **Deployed Functions** — what's currently running. Each row shows the version, last-updated date, and a copy-able public URL.
If you don't have any functions yet, click **Create Sample** to generate a working "hello world" you can deploy immediately.
***
## Deploying a Function
Click **Deploy** (or **Redeploy** if you've changed the code) next to a workspace function. Takes a few seconds. Or just ask the agent: *"Deploy my payment function."*
When OptiDev Agent creates a function, it usually deploys it automatically right after.
***
## Viewing Logs
Click **Logs** on any deployed function to jump to the **Logs** tab pre-filtered to that function. You can switch between **Invocations** (per-request details — method, status, duration) and **Console logs**.
See [Logs](/optidev-cloud/logs) for more.
***
## Deleting a Function
Click the **trash icon** on a deployed function row and confirm.
Deletion is immediate. Any app or webhook calling the function will start getting errors. Make sure nothing is using it first.
***
## Secrets
The right panel of the Edge Functions tab is where you store sensitive values your functions need — API keys, third-party tokens, connection strings. Secrets are encrypted at rest and only available to server-side code, never the browser.
### Adding secrets
The **Add new** form is always visible. Type a name (auto-uppercased, e.g. `STRIPE_SECRET_KEY`), paste the value (use the eye icon to peek), click **Add row** to stage more in the same save, then click **Save**. Names must be `UPPERCASE_WITH_UNDERSCORES_AND_DIGITS` and can't be reused.
### Deleting a secret
Click the **trash icon** next to a secret and confirm.
Secrets are **write-only**. You can see the name and last-updated date, but not the value. To change a value, delete and re-add.
Deleting a secret is immediate. Any function reading it will start failing until you add it back.
### Auto-available variables
`SUPABASE_URL` and `SUPABASE_ANON_KEY` are always available inside Edge Functions — no need to add them as secrets. For privileged operations (admin DB access, user management), let OptiDev Agent write the code so you never have to handle those credentials yourself.
### Using a secret
Just reference the name when asking the agent: *"Create a Stripe payment function using my STRIPE\_SECRET\_KEY secret."* The agent reads it via `Deno.env.get('STRIPE_SECRET_KEY')` so the value stays server-side.
***
## Common Use Cases
* **Webhook handlers** — *"Receive Stripe webhooks and update order status."*
* **Form submissions** — *"Receive contact form submissions and send them to my email."*
* **Data processing** — *"Take a CSV upload and import it into the products table."*
* **Scheduled tasks** — *"Run daily to send appointment reminder emails."*
* **Third-party sync** — *"Sync new customers to my Mailchimp list."*
***
## For Developers
### Function file structure
Edge Functions are TypeScript/JavaScript on Deno. Each lives at:
```
supabase/functions/function-name/index.ts
```
### Function URL
```
https://your-project.sb.optidev.ai/functions/v1/function-name
```
### Invoking from your app
```typescript theme={null}
const { data, error } = await supabase.functions.invoke('function-name', {
body: { amount: 2500 }
})
```
### Accessing secrets
```typescript theme={null}
const stripeKey = Deno.env.get('STRIPE_SECRET_KEY')
```
Secrets are available immediately after saving — no redeploy needed. All values are AES-256-GCM encrypted at rest, scoped per workspace.
### Logging
`console.log()`, `console.error()`, etc. show up in the Logs tab under Console Logs.
### CORS
The sample function template includes CORS headers. Reuse that pattern for any function called from the browser.
### Naming conventions
Use `UPPERCASE_WITH_UNDERSCORES`. Be descriptive (`STRIPE_SECRET_KEY`, not `SK`) and prefix with the service (`HUBSPOT_API_KEY`).
# How to Use
Source: https://docs.optidev.ai/optidev-cloud/how-to-use
Getting started with OptiDev Cloud
## What is OptiDev Cloud
OptiDev Cloud is a ready-to-use backend for your app. It gives you everything you need to build real applications:
* **Database** - Store and organize your app's data (user profiles, orders, messages, etc.)
* **Authentication** - Let users create accounts and log in securely
* **Edge Functions** - Run server-side code for things like payment processing or sending emails
* **Secrets** - Securely manage environment variables and API keys
* **Storage** - Store files like images, documents, and videos
* **Advisors** - Get security and performance recommendations
The best part? You don't need to set up servers or manage infrastructure. OptiDev Cloud is powered by Supabase, giving you production-grade PostgreSQL and infrastructure without any setup. Just activate OptiDev Cloud and start building.
### Works with OptiDev Agent
OptiDev Agent understands OptiDev Cloud automatically. You can simply describe what you need:
* *"Create a table to store customer orders with name, email, and order total"*
* *"Add user login to my app"*
* *"Create an API endpoint that connects to Stripe for payments"*
* *"Set up file upload for profile pictures"*
OptiDev Agent will create the tables, set up authentication, write the functions, and deploy everything for you.
***
## Activating OptiDev Cloud
### Step 1: Open OptiDev Cloud
In your project, click the **OptiDev Cloud** tab in the left sidebar (cloud icon).
### Step 2: Choose a Region
Select a region closest to where your users are located:
| Region | Best for |
| ------------------------ | ----------------- |
| US East (Ohio) | North America |
| EU Central (Frankfurt) | Europe |
| AP Southeast (Singapore) | Asia |
| AP Southeast (Sydney) | Australia/Oceania |
Choosing a closer region means faster response times for your users.
### Step 3: Activate
Click the **Activate OptiDev Cloud** button. You'll see a progress bar while your backend is being set up.
**Instant Activation:** OptiDev Cloud uses a warm pool system that pre-provisions resources, so activation typically completes in under a second (compared to 2-3 minutes for traditional backends). The progress bar shows elapsed time and updates every few seconds.
When complete, you'll see a green **Active** badge and the dashboard will load with all tabs ready to use.
Once activated, OptiDev Cloud is ready to use immediately. OptiDev Agent can start creating tables, functions, and storage buckets right away.
***
## The OptiDev Cloud Dashboard
After activation, you'll see **8 tabs** for managing your backend:
### Connection Info
Access your API credentials and database connection details:
* **API URL** - Your secure gateway endpoint for API calls
* **Publishable Key** - Public API key for frontend code
* **Database Connection** - PostgreSQL connection strings in 9 formats
* **Reset Password** - Generate a new database password
Click the copy icon to copy any value to your clipboard.
[Learn more about Connection Info →](/optidev-cloud/connection-info)
### Database
Browse and query your data with a full-featured SQL editor:
* **Table List** - See all your tables in the left sidebar (only public schema tables are shown)
* **SQL Editor** - Monaco-powered editor with syntax highlighting
* **Click to Query** - Click any table name to instantly view its data (first 10 rows)
* **Query Results** - View results in a table with row count display
* **Export Data** - Download results as CSV, JSON, or XLSX
The SQL editor supports multi-line queries and shows null values, objects, and strings with proper formatting.
[Learn more about Database →](/optidev-cloud/database)
### Auth
Manage user authentication with multiple sign-in methods. Email/Password is enabled by default.
Key features:
* **Sign-in Providers** - Enable Email, Phone (SMS), or Google authentication
* **Auth Settings** - Configure Site URL, allowed redirect URLs, and signup options
* **User Signup Controls** - Allow/disable new signups, enable anonymous users
[Learn more about Auth →](/optidev-cloud/auth)
### Users
View and manage registered users in your app.
Key features:
* **User List** - Search and browse all users with pagination
* **Create Users** - Manually create user accounts
* **Invite Users** - Send email invitations for self-registration
* **Delete Users** - Remove user accounts
[Learn more about Users →](/optidev-cloud/users)
### Edge Functions
Run server-side code for APIs, integrations, and background tasks.
Key features:
* **Workspace Functions** - Functions in your code, ready to deploy
* **Deployed Functions** - Functions running on OptiDev Cloud
* **One-click Deploy** - Deploy functions directly from the dashboard
* **Testing Tools** - Test functions with custom requests before connecting to your app
[Learn more about Edge Functions →](/optidev-cloud/edge-functions)
### Secrets
Securely store API keys and environment variables for your Edge Functions.
Key features:
* **Write-Only Security** - Secret values can never be retrieved after saving
* **Bulk Operations** - Add multiple secrets at once before saving
* **Instant Access** - Secrets are immediately available in Edge Functions via `Deno.env.get()`
[Learn more about Secrets →](/optidev-cloud/secrets)
### Storage
Manage file storage with buckets for images, documents, and videos. The Storage tab shows all your buckets with public/private badges.
Key features:
* Create buckets with file size limits and MIME type restrictions
* Browse files with folder navigation
* Upload files directly from your computer
* View and manage Row Level Security (RLS) policies
[Learn more about Storage →](/optidev-cloud/storage)
### Advisors
Automatically scan your database for security vulnerabilities and performance issues:
* **Security checks** - Missing Row Level Security, exposed data, weak access policies
* **Performance checks** - Missing indexes, slow queries, inefficient configurations
* **Severity filtering** - View by ERROR (critical), WARN (important), or INFO (suggestions)
* **One-click remediation** - Copy SQL fixes directly from issue details
Click any issue to see full details including affected tables and remediation SQL. OptiDev Agent can also fix many issues automatically.
[Learn more about Advisors →](/optidev-cloud/advisors)
***
## Using OptiDev Agent with OptiDev Cloud
The easiest way to work with OptiDev Cloud is through OptiDev Agent. Just describe what you need in plain language.
### Creating Tables
Tell OptiDev Agent what data you want to store:
> *"Create a products table with name, description, price, and image URL"*
OptiDev Agent will:
1. Create the table with the right column types
2. Set up the database schema
3. Show you the table in your dashboard
### Adding Authentication
Ask OptiDev Agent to add login:
> *"Add user authentication to my app with email and Google sign-in"*
OptiDev Agent will:
1. Enable the auth providers
2. Add sign-in forms to your app
3. Connect everything together
### Creating API Endpoints
Describe the functionality you need:
> *"Create an API endpoint that accepts payment with Stripe and saves the order to the database"*
OptiDev Agent will:
1. Create an Edge Function with the Stripe integration
2. Deploy it to OptiDev Cloud
3. Connect it to your frontend
### Working with Storage
Ask OptiDev Agent to set up file storage:
> *"Add profile picture upload to user settings and display them next to usernames"*
[Learn more about Storage →](/optidev-cloud/storage)
### Managing Secrets
Request secure environment variable storage:
> *"Store my Stripe API key securely so I can use it in Edge Functions"*
OptiDev Agent will:
1. Create a secret with your API key
2. Update your Edge Function code to use `Deno.env.get('STRIPE_API_KEY')`
3. Ensure the secret is never exposed in your frontend
### What OptiDev Agent Can Do
OptiDev Agent has access to **20 specialized tools** for OptiDev Cloud:
**Database (2 tools)**
* Query database via PostgREST API
* Execute DDL SQL for schema changes and RLS policies
**Authentication (1 tool)**
* List and manage authenticated users
**Edge Functions (3 tools)**
* List deployed functions
* Deploy functions from workspace
* Get function source code
**Storage (7 tools)**
* List, create, update, and delete buckets
* Upload files with presigned URLs
* List and delete files
* Browse folders with prefix filtering
**Secrets (3 tools)**
* List secrets (names and digests only)
* Create write-only secrets
* Delete secrets in bulk
**Debugging (2 tools)**
* Fetch service logs (api, postgres, edge-function, auth, storage, realtime)
* Get security and performance advisor recommendations
**Project (1 tool)**
* Get project info and activation status
**HITL Activation (1 tool)**
* Request OptiDev Cloud activation with inline button in chat
These tools enable OptiDev Agent to autonomously manage your backend, from initial setup to ongoing maintenance and optimization.
***
## Checking Your Data
### Viewing Tables
1. Go to the **Database** tab
2. Click any table name in the left sidebar
3. Browse rows using the pagination controls at the bottom
### Editing Data
* **Double-click** any cell to edit it
* Press **Enter** to save or **Escape** to cancel
* Click **Add Row** to create a new entry
### Running Queries
Type SQL in the editor to search or analyze your data:
```sql theme={null}
SELECT * FROM orders WHERE total > 100
```
Click **Execute Query** to see results. The result table shows the row count and handles null values, objects, and strings with proper formatting.
***
## Viewing Users
1. Go to the **Users** tab
2. You'll see a paginated list of all registered users
3. Each user shows:
* Email address
* When they signed up
* Last sign-in time
* Auth provider used (email, phone, or Google)
Use the pagination controls at the bottom to navigate through large user lists.
***
## Monitoring Edge Functions
### Viewing Deployed Functions
1. Go to the **Edge Functions** tab
2. **Deployed Functions** shows all functions running on OptiDev Cloud
3. Each function shows its name, version, and last update time
If you see a **"Needs Sync"** badge, it means the workspace version is different from the deployed version.
### Function Details
Click **View Details** on any function to see:
* Function URL (for calling from your app)
* Execution history
* Recent invocations
* Version number
### Testing Functions
1. Click **Test** next to any deployed function
2. Choose the HTTP method (GET, POST, PUT, PATCH, DELETE)
3. Add headers, query parameters, or request body data
4. Click **Send Request** to see the response
The response shows:
* Status code with color-coded badge
* Response body (formatted JSON)
This is useful for debugging before connecting to your app.
***
## For Developers
### Environment Variables
When you activate OptiDev Cloud, these environment variables are automatically added to your project's `.env.local`:
* `VITE_SUPABASE_URL` - Your secure gateway URL (routes requests through OptiDev's gateway with automatic session management)
* `VITE_SUPABASE_GATEWAY_URL` - Same as above, provided for compatibility
* `VITE_SUPABASE_PUBLISHABLE_KEY` - Your public API key
### Supabase Client
OptiDev Cloud is built on Supabase. You can use the Supabase JavaScript client directly:
```bash theme={null}
npm install @supabase/supabase-js
```
A pre-configured client is created at `src/lib/supabaseClient.ts` when you activate OptiDev Cloud.
### Database Connection
The connection string uses session pooler (port 5432) for full PostgreSQL compatibility. Use it with any PostgreSQL client or ORM.
The pooler provides dynamic host resolution via Supabase's pooler config API for optimal connection management.
### Edge Functions Runtime
Functions run on Deno with TypeScript support. Access secrets via `Deno.env.get('SECRET_NAME')`.
**Auto-injected environment variables:**
* `SUPABASE_URL` - Your project URL
* `SUPABASE_ANON_KEY` - Public (publishable) key
* `SUPABASE_SERVICE_ROLE_KEY` - Admin key with full access
* `SUPABASE_DB_URL` - Direct database connection string
### Storage Integration
Upload files using presigned URLs for efficient binary transfer (33% more efficient than base64):
```typescript theme={null}
// OptiDev Agent handles this automatically
const { data, error } = await supabase.storage
.from('avatars')
.upload('user-123.jpg', file)
```
### Encryption and Security
All OptiDev Cloud configurations (API keys, connection strings, secrets) are encrypted using AES-256-GCM with your workspace encryption key. Data is automatically encrypted before storage and decrypted on retrieval.
### Multi-Tenant Isolation
All queries are automatically scoped to your workspace ID, ensuring complete isolation between different projects and users.
### Warm Pool System
OptiDev Cloud uses a warm pool of pre-provisioned Supabase projects for instant activation (under 100ms vs 2-3 minutes). The system automatically replenishes the pool in the background and falls back to direct provisioning if the pool is empty.
# Logs
Source: https://docs.optidev.ai/optidev-cloud/logs
Inspect requests, errors, and console output from your backend services
## What is the Logs Tab
The Logs tab shows real-time activity across every part of your OptiDev Cloud backend — useful for debugging failed requests, watching Edge Function output, or confirming that your auth flow is working.
***
## Choosing What to Look At
Two dropdowns at the top of the tab control what you see:
**Source** — pick one service to inspect:
* **Edge Functions** — your serverless function activity
* **Authentication** — sign-ups, logins, password resets
* **Storage** — file uploads, downloads, bucket changes
* **API Gateway** — all HTTP traffic into your project
* **Postgres** — database server events
**Time range** — Last 15 minutes, 1 hour, 3 hours, or 24 hours.
Click the refresh icon to pull the latest entries.
***
## Edge Functions: Invocations vs Console Logs
When the source is **Edge Functions**, an extra toggle appears:
* **Invocations** — one row per HTTP request: timestamp, function name, method, status code, path, and duration in milliseconds. Color-coded (green for 2xx, red for 4xx/5xx).
* **Console logs** — anything your function printed with `console.log`, `console.error`, etc., with the log level shown.
You can also filter to a single function using the function picker. (When you click **Logs** from a deployed function row in the Edge Functions tab, this filter is set for you automatically.)
***
## Reading a Log Entry
Click any row to expand it and see the full metadata — headers, payload, error stack, or whatever the underlying service emitted. Click again to collapse.
For Edge Function invocations, the expanded view gives you the full request and response context, which is the fastest way to debug a failing call.
***
## Common Debugging Workflows
**A function is throwing errors** → Source = Edge Functions, view = Invocations, look for red rows; expand to see the response body.
**A user can't sign in** → Source = Authentication, recent time range; expand entries to see the failure reason.
**A file upload failed** → Source = Storage, look for non-2xx status codes.
**The whole app feels slow** → Source = API Gateway, check duration on recent requests.
Logs are retained for a limited time (typically a few days). For long-term audit history you'll need to forward logs to your own storage.
***
## For Developers
### API endpoints
```http theme={null}
GET /api/supabase/projects/:projectId/logs/:service?limit=100
GET /api/supabase/projects/:projectId/functions/:functionId/invocations
```
`:service` is one of `api`, `postgres`, `edge-function`, `auth`, `storage`, `realtime`.
### Deep-linking from Edge Functions
The Edge Functions tab passes `?functionSlug=` when navigating to Logs, which pre-selects that function in the picker.
### Log levels
Console logs surface the standard Deno log levels: `log`, `info`, `warn`, `error`, `debug`.
# Storage
Source: https://docs.optidev.ai/optidev-cloud/storage
Store and serve files like images, documents, and videos
## What is Storage
Storage is where your app keeps files - profile pictures, uploaded documents, product images, videos, and any other files your users need.
OptiDev Cloud Storage gives you:
* **Fast global delivery** - Files are served through a CDN, so they load quickly worldwide
* **Flexible access control** - Make files public for everyone or private for specific users
* **Organized structure** - Group files into "buckets" for different purposes
* **Upload restrictions** - Set file size limits and allowed file types per bucket
***
## Understanding Buckets
Files are organized into **buckets** - think of them like folders for different types of content.
### Public vs Private Buckets
**Public buckets:**
* Anyone with the URL can view the files
* Good for: profile pictures, product images, public assets
* Files have permanent, shareable URLs
**Private buckets:**
* Only authorized users can access files
* Good for: personal documents, invoices, sensitive data
* Files require special "signed URLs" with expiration times
***
## Using Storage with OptiDev Agent
The easiest way to add file storage to your app is to describe what you need.
### Example: Profile Pictures
> *"Add profile picture upload to my user settings page and display them next to usernames"*
OptiDev Agent will:
1. Create a storage bucket for avatars
2. Add an upload component to your settings page
3. Save the image URL to the user's profile
4. Display the picture throughout your app
### Example: Document Uploads
> *"Let users upload PDF documents to their account with a download button for each file"*
OptiDev Agent will:
1. Set up a private storage bucket for documents
2. Create an upload interface
3. Build a file list with download buttons
4. Set up access policies so users only see their own files
### Example: Public Gallery
> *"Create a public image gallery where anyone can see the images but only authenticated users can upload"*
OptiDev Agent will:
1. Create a public storage bucket for the gallery
2. Add an image upload component for logged-in users
3. Display a gallery view visible to everyone
4. Set up policies for public read and authenticated upload
***
## Managing Buckets in the Dashboard
### Viewing Your Buckets
1. Go to the **Storage** tab in OptiDev Cloud
2. You'll see a grid of bucket cards
3. Each card shows the bucket name and a **Public** or **Private** badge
### Creating a New Bucket
1. Click the **New bucket** button
2. Enter a bucket name (this cannot be changed later)
3. Choose visibility:
* **Public** - Anyone can view files
* **Private** - Only authorized users can access
4. Optionally set restrictions (see Bucket Settings below)
5. Click **Create bucket**
### Bucket Settings
Click any bucket to open it, then click the **Edit bucket** dropdown and select **Bucket settings** to configure:
**File Size Limit**
* Toggle on to restrict maximum file size
* Enter the limit in megabytes (MB)
* Uploads exceeding this size will be rejected
* Default is 50 MB if not set
**Allowed File Types**
* Toggle on to restrict which file types can be uploaded
* Enter MIME types separated by commas
* Examples: `image/png, image/jpeg` or `application/pdf`
Bucket settings help prevent users from uploading inappropriate or oversized files. Set these before adding upload functionality to your app.
### Emptying or Deleting a Bucket
1. Click the bucket you want to modify
2. Click the **Edit bucket** dropdown
3. Select **Empty bucket** to delete all files but keep the bucket, or **Delete bucket** to remove everything
4. Confirm the action
Both actions are permanent and cannot be undone.
***
## Browsing Files in the Dashboard
Click any bucket to view its contents:
* **Breadcrumb navigation** - Shows your current location (e.g., `avatars / users / profile-pics`)
* **File table** - Lists all files and folders with Name, Size, and Modified date
* **Folder navigation** - Click any folder to enter it
* **Back button** - Return to the bucket list
### Uploading Files
1. Click a bucket to open it
2. Navigate to the folder where you want to upload (or stay at root)
3. Click the **Upload** button
4. Select files from your computer
5. Files upload directly to storage
### Deleting Files
1. Find the file you want to delete
2. Click the **trash icon** next to the file
3. Confirm the deletion
***
## Viewing Storage Policies
Storage policies (Row Level Security) control who can access files in each bucket.
### Viewing Policies
1. Click a bucket to open it
2. Click the **Policies** button
3. A modal shows all security rules for this bucket
### Understanding Policies
Each policy shows:
* **Policy name** - Descriptive name for the rule
* **Command** - What action it controls (SELECT, INSERT, DELETE, etc.)
* **Applies to** - Who the rule affects:
* `public` - Anyone, including users who are not logged in
* `authenticated` - Only users who are logged in
* Other custom roles as defined in your app
* **Definition** - The actual security condition
### Modifying Policies
Policies cannot be edited directly in the dashboard. To create or change policies, describe the access rules you want to OptiDev Agent:
> *"Only let authenticated users upload files to the documents bucket"*
> *"Users should only be able to see and delete their own files"*
> *"Make the avatars bucket publicly readable but only allow uploads from logged-in users"*
OptiDev Agent will create the appropriate Row Level Security policies for you.
***
## Storage Limits and Quotas
OptiDev Cloud includes storage with your plan:
* Files are stored securely with automatic backups
* Large files are handled efficiently
* No per-file charges for standard usage
Check your plan details for specific storage limits.
***
## For Developers
### Supabase Storage Client
Upload files using the Supabase JavaScript client:
```typescript theme={null}
const { data, error } = await supabase.storage
.from('avatars')
.upload('user-123.jpg', file)
```
### Getting Public URLs
```typescript theme={null}
const { data } = supabase.storage
.from('avatars')
.getPublicUrl('user-123.jpg')
// data.publicUrl contains the URL
```
### Creating Signed URLs
For private files with expiration:
```typescript theme={null}
const { data, error } = await supabase.storage
.from('documents')
.createSignedUrl('invoice.pdf', 3600) // expires in 1 hour
// data.signedUrl contains the temporary URL
```
### Listing Files
```typescript theme={null}
const { data, error } = await supabase.storage
.from('documents')
.list('user-123/') // list files in a folder
```
### Deleting Files
```typescript theme={null}
const { error } = await supabase.storage
.from('avatars')
.remove(['user-123.jpg'])
```
### Bucket Configuration
When creating buckets programmatically, you can set:
```typescript theme={null}
{
name: 'documents',
public: false,
fileSizeLimit: 10485760, // 10MB in bytes
allowedMimeTypes: ['application/pdf', 'image/png', 'image/jpeg']
}
```
### Row Level Security Policies
Control access with RLS policies on the `storage.objects` table. Common patterns:
**Public read access:**
```sql theme={null}
CREATE POLICY "Public read" ON storage.objects
FOR SELECT USING (bucket_id = 'avatars');
```
**Authenticated uploads:**
```sql theme={null}
CREATE POLICY "Auth upload" ON storage.objects
FOR INSERT WITH CHECK (
bucket_id = 'documents'
AND auth.role() = 'authenticated'
);
```
**Per-user isolation:**
```sql theme={null}
CREATE POLICY "User files" ON storage.objects
FOR ALL USING (
bucket_id = 'documents'
AND auth.uid()::text = (storage.foldername(name))[1]
);
```
This requires files to be stored as `{user_id}/filename.ext`.
Ask OptiDev Agent to set up RLS policies:
> *"Only let users access their own files in the documents bucket"*
# Usage & Pricing
Source: https://docs.optidev.ai/optidev-cloud/usage-and-pricing
Understand how OptiDev Cloud usage is metered and billed
Usage tracking began on April 1st, 2026. Balance deductions will start on **April 9th, 2026**.
## How Cloud Billing Works
OptiDev Cloud uses **usage-based billing**. You get a monthly dollar allowance based on your plan, and usage is charged in tiers as you go.
| Plan | Monthly Cloud Allowance |
| ------------ | ----------------------- |
| **Free** | \$0/month |
| **Standard** | \$10/month |
| **Pro** | \$15/month |
Your first workspace gets a **\$5 starter credit** that never expires. This is added to your balance on top of your plan allowance. Additional workspaces do not receive this starter credit.
### Billing Cycle
* **Reset date**: 1st of each month
* **Charges**: Applied when you cross into a new usage tier
* Plan allowance resets on the 1st regardless of when you subscribed
* Top-up balance never resets — carries over month-to-month
***
## Your Cloud Balance
Your total cloud balance combines two parts:
1. **Plan Allowance** — Resets on the 1st of each month
2. **Top-up Balance** — Never expires, carries over month-to-month
When charges occur, your plan allowance is used first. Once that's depleted, charges come from your top-up balance.
### Checking Your Balance
1. Go to **Dashboard** → **Settings** → **Cloud Usage**
2. View your current cloud balance and usage breakdown
3. See which services are consuming your allowance
***
## Usage Pricing
Usage is billed in tiers. When you cross into a new tier, you're charged for that tier.
| Service | Tier Size | Price per Tier |
| ------------------------ | -------------------- | -------------- |
| **Edge Functions** | 1M invocations | \$2.00 |
| **App Traffic** | 1M requests | \$1.00 |
| **Realtime Messages** | 1M messages | \$1.00 |
| **Realtime Connections** | 100 peak connections | \$1.00 |
| **Asset Storage** | per GB | \$0.015 |
| **Additional Projects** | per cloud project | \$3.00 |
Each plan includes free cloud projects: **Free: 1**, **Standard: 3**, **Pro: 6**. Only projects with OptiDev Cloud activated count toward this limit — regular projects without cloud don't count.
**Example**: If your edge functions hit 1.5M invocations, you've entered the 2nd tier and are charged \$4 total (2 tiers × \$2).
***
## Adding Funds
When your balance runs low, you can add funds anytime:
1. Go to **Settings** → **Cloud Usage**
2. Click **Add Funds**
3. Choose an amount
4. Complete payment through Stripe
Added funds go to your **top-up balance** and never expire.
### Auto-Replenish
Set up automatic top-ups so you never run out:
1. Go to **Settings** → **Billing**
2. Enable **Auto-Replenish**
3. Set your threshold (e.g., when balance drops below \$5)
4. Set your replenish amount (e.g., add \$25)
When your balance drops below the threshold, we'll automatically charge your saved payment method.
***
## What Happens When Balance Runs Out
If your cloud balance goes negative:
* New cloud activations are blocked
* New publishes are blocked
* Existing published apps continue working
**After 5 days (grace period):**
* Published apps show a "Project Paused" page
**When you add funds:**
* Services resume immediately — no waiting
Your data is never deleted. Add funds anytime to restore access.
***
## FAQ
No. Your plan allowance resets on the 1st of each month. However, your top-up balance (including the \$5 starter credit on your first workspace) never expires.
App traffic counts all HTTP requests to your published app and backend APIs.
The maximum number of simultaneous WebSocket connections at any point during the billing period.
Currently, you can use auto-replenish thresholds to manage spending. Hard spending limits are coming soon.
Your plan allowance resets to \$0 at the next billing cycle. Your top-up balance remains available and never expires.
# Securing Your App
Source: https://docs.optidev.ai/security/securing-your-app
Control who can access your app and keep your data safe
## Public vs Private Apps
Every app you build has a visibility setting that controls who can access it.
| Visibility | Who Can Access | Best For |
| ----------- | ------------------------------------------- | -------------------------------------------------- |
| **Public** | Anyone with the link | Marketing sites, portfolios, public tools |
| **Private** | Only workspace members + OptiSigns displays | Internal dashboards, sensitive data, company tools |
### Changing Visibility
In the Power Editor, click the **gear icon** next to your project name, or go to **Settings** tab.
Scroll to **Project Information** and look for **Content Visibility**.
Choose **Public** or **Private**. Your choice takes effect after your next publish.
Changing from public to private doesn't revoke access immediately. Publish again to apply the new setting.
***
## Securely Display on OptiSigns Screens
If you're using OptiSigns digital signage, your private apps can display on screens without exposing them to the public internet.
### How It Works
1. **Private apps stay private** — they're only accessible through authenticated OptiSigns hardware
2. **No public URLs** — viewers can't bookmark or share a direct link to your content
3. **Workspace-level control** — manage which screens can display your apps
### Setting Up OptiSigns Display
Go to **Workspace Settings → API Keys** and click **Generate Key**.
You'll see a Key ID and Secret. **Save the secret now** — you won't see it again.
In your OptiSigns account, add the API key to link your workspace.
Browse your OptiDev apps from within OptiSigns and add them to your playlist.
Your API key works for all apps in your workspace. You only need to set this up once.
***
## Adding Auth to Your App
Want users to log in before accessing your app? OptiDev Cloud includes built-in authentication — no coding required.
### What You Get
* **Email/password login** — users create accounts with their email
* **Social login** — let users sign in with Google (more providers coming soon)
* **User management** — see who signed up, disable accounts, reset passwords
### Enabling Authentication
In your project, go to **Settings → OptiDev Cloud** and click **Activate**.
This takes about 2-3 minutes the first time (instant after that).
Once active, click the **Auth** tab. Toggle on the login methods you want:
* **Email** — users sign up with email and password
* **Phone** — users sign up with phone number (SMS verification)
* **Google** — one-click Google sign-in
Toggle **Disable Signup** if you want to manually add users instead of allowing self-registration.
After enabling auth, your app needs login UI. Ask the Agent: *"Add a login page using OptiDev Cloud Auth"* — it handles the rest.
### Managing Users
Once auth is enabled, the **Users** tab shows everyone who signed up. From here you can:
* See when users last signed in
* Disable or delete accounts
* View user metadata
***
## Run Security Review on Your App
Before publishing, it's good practice to review your app for common security issues.
### Pre-Publish Checklist
Is your app **Public** when it should be **Private**? Double-check in Project Settings before publishing.
Go to **Settings → Secrets** and verify:
* API keys are marked as **Sensitive** (hidden from logs)
* No test credentials left in production
* Database passwords aren't visible to collaborators who shouldn't see them
If your app has login:
* Try accessing protected pages without signing in
* Verify logout actually logs users out
* Test password reset if enabled
Review **Settings → Connections** for any services your app uses. Make sure:
* Test/sandbox connections aren't used in production
* Unused connections are removed
### Ask the Agent for Help
Not sure if something is secure? Ask Claude directly:
> *"Review my app for security issues before I publish"*
The Agent will scan your code for common problems like exposed credentials, missing auth checks, or insecure API calls.
***
## For Developers
### Visibility Implementation
* Visibility stored in `projects.visibility` column (`PUBLIC` | `PRIVATE`)
* Private projects require workspace membership or valid OptiSigns hardware token
* Setting change requires republish — cached CDN content isn't invalidated automatically
### OptiSigns Integration
* API keys are workspace-scoped, stored with AES-256-GCM encryption
* Key pair: `keyId` (public identifier) + `secret` (one-time display)
* Hardware authentication uses HMAC signature validation
### OptiDev Cloud Auth
* Built on Supabase Auth with session pooler (port 5432)
* Environment variables injected: `VITE_SUPABASE_URL`, `VITE_SUPABASE_PUBLISHABLE_KEY`
* Supports JWT verification, row-level security policies
* Auth state managed client-side via `@supabase/supabase-js`
### Secrets Security
* All secrets encrypted at rest with AES-256-GCM
* Three visibility levels: Visible, Masked (first/last 4 chars), Sensitive (hidden)
* 64KB total budget per project for environment variables
***
## What's Next?
Set up enterprise SSO with your company's identity provider.
Learn more about database, auth, and backend features.
# Security Overview
Source: https://docs.optidev.ai/security/security-overview
How OptiDev protects your data, code, and credentials
OptiDev is built for enterprise teams. This page explains the security controls in place across infrastructure, authentication, data handling, and AI.
## Infrastructure & Data Residency
All customer data is stored and processed in the United States.
| Provider | Role | Region |
| --------------------------- | -------------------------------------- | ---------------------- |
| Oracle Cloud Infrastructure | Compute, Database, Redis | US |
| Cloudflare | CDN, DDoS protection, TLS, R2 storage | Global edge, US origin |
| Supabase | Backend-as-a-service for user projects | User-chosen |
### Network Architecture
Customer requests pass through Cloudflare for TLS termination and DDoS protection before reaching the OptiDev API. Development containers run inside Kubernetes and are never directly reachable from the internet — access is issued only after the API has verified your identity and confirmed ownership.
### Network Isolation
Each development container is isolated at the network layer:
* **No inter-container communication** — containers cannot reach each other
* **Egress restricted** — outbound traffic is limited to necessary external services
* **No lateral movement** between workspaces at the network layer
***
## Authentication & Access Control
### Identity
OptiDev uses **Google Authentication** as the identity layer. Tokens are verified server-side on every API request — client-supplied tokens are never trusted without server-side verification. Unauthenticated requests are rejected.
### Enterprise SSO (SAML 2.0)
SSO is available on Enterprise plans. See the [Single Sign-On guide](/security/single-sign-on) for setup instructions.
Connect your existing identity provider via SAML 2.0. Supported out of the box:
* Okta
* Azure Active Directory / Microsoft Entra ID
* Any SAML 2.0-compliant IdP
SAML features include:
* **Just-in-time provisioning** — accounts created automatically on first login, no manual provisioning needed
* **Group-based role assignment** — map IdP groups to workspace roles (Admin, User, Viewer)
* **Configurable attribute mapping** — handles non-standard attribute names across IdPs
* **Domain verification required** — only verified domain administrators can configure SSO
* **Sync on login** — optionally keep display name and workspace membership in sync with your IdP
### Multi-Factor Authentication (MFA)
MFA is available through OptiPrime, our identity platform:
* **TOTP** — Google Authenticator, Authy, 1Password, or any TOTP app
* **SMS** — phone number verification
* **Backup codes** — securely hashed before storage; single-use with usage tracking
Sensitive operations like disabling MFA or regenerating backup codes require re-authentication before proceeding.
### OAuth 2.0 + PKCE
All OAuth flows use **PKCE (Proof Key for Code Exchange)** with SHA-256. Plain PKCE is rejected. Authorization codes are short-lived and single-use.
### Role-Based Access Control (RBAC)
Workspace roles — **Owner**, **Admin**, **User**, and **Viewer** — determine what each member can do. Permissions are enforced server-side on every request, not just at the UI layer.
### Multi-Tenant Data Isolation
Every database query is scoped to your workspace. It is architecturally impossible for a query to return data belonging to another workspace or organization.
***
## Data Security
### Encryption at Rest
All secrets, API keys, and third-party credentials are encrypted before being written to the database using **AES-256-GCM**. The encryption key is derived from a master secret not accessible to application-layer code or OptiDev employees. Decrypted values are never written to logs.
### Encryption in Transit
All traffic is encrypted via **TLS 1.2+** enforced at the Cloudflare edge. Internal service-to-service communication runs over private cluster networking.
### Secret Visibility Tiers
OptiDev gives you fine-grained control over how secrets are handled in the UI:
| Tier | Behavior |
| ------------- | ----------------------------------------------------------------------- |
| **Visible** | Always shown in plain text — for non-sensitive config values |
| **Masked** | Hidden by default; user can reveal temporarily with a toggle |
| **Sensitive** | Write-only — once saved, the value can never be retrieved, only rotated |
### No Secrets in Logs
Decrypted secret values are never written to application logs. Logs contain only IDs, key names, and metadata.
### Presigned URLs for Build Artifacts
Build outputs, deployment packages, and code archives are delivered via time-limited presigned URLs. No cloud credentials are ever injected into container environments.
***
## Development Container Security
Each workspace gets a dedicated container running in full isolation:
* Runs in its own Kubernetes namespace — no shared runtime with other workspaces
* Network policies deny all ingress between containers
* Resource quotas are enforced per container
* Containers run as non-root users
Access to your container is brokered exclusively through the OptiDev API after authentication. There is no path for one user to access another user's container.
***
## AI Security
OptiDev's AI assistant is powered by Anthropic's Claude API.
### What the AI can access
* Files in your current project
* Project metadata (name, framework type)
* Your conversation history within the active session
### What the AI cannot access
* Files or data from other workspaces
* Your secrets or API keys — decrypted values are never passed to the AI
* Data from other users or tenants
### AI data handling
Per Anthropic's API data usage policy, customer code and conversations submitted via the API are not used to train AI models.
* AI sessions are scoped to a single workspace — no cross-workspace context leakage
* API keys for AI calls are injected at runtime — no credentials are embedded in container images
***
## Compliance
OptiDev is developed by **[OptiSigns](https://www.optisigns.com/security)**, a **SOC 2 Type II certified** company.
***
## Third-Party Subprocessors
| Subprocessor | Role | Region |
| --------------------------- | --------------------------------------------------- | ------ |
| Oracle Cloud Infrastructure | Compute, object storage, Database, Redis | US |
| Cloudflare | CDN, DDoS protection, TLS, R2 storage | US |
| Google Firebase | User authentication, MFA, SAML federation | US |
| Anthropic | AI coding assistant | US |
| Google Gemini | Image generation | US |
| Stripe | Payment processing | US |
| Supabase | Backend-as-a-service provisioning for user projects | US |
***
Set up SAML SSO with Okta, Azure AD, or any SAML 2.0 provider.
Best practices for securing apps you build and publish on OptiDev.
Store and manage environment variables and credentials securely.
Questions about security? Contact our support team.
# Single Sign-On (SSO)
Source: https://docs.optidev.ai/security/single-sign-on
Let your team log in with company credentials
## What is SSO?
Single Sign-On lets your team access OptiDev using their existing company login — the same one they use for email, Slack, or other work apps.
**Benefits:**
* **One password** — no separate OptiDev account to remember
* **IT control** — manage access through your identity provider
* **Instant offboarding** — when someone leaves, access is revoked automatically
***
## How It Works
**User** → **Your Identity Provider** → **OptiDev**
1. User visits OptiDev and clicks **Sign in with SSO**
2. They're redirected to your company's login page
3. After entering their company credentials, they're sent back to OptiDev
4. OptiDev creates their account automatically on first login
***
## Before You Start
You'll need:
You need to create a new SAML application in your identity provider.
The domain you want to enable SSO for (e.g., `yourcompany.com`).
Contact support to set up SSO for your organization — we support any SAML 2.0 compliant identity provider.
***
## What Happens After Setup
### For Your Team
* Employees visit OptiDev and click **Sign in with SSO**
* They enter their company email and are redirected to your IdP
* After authentication, they land in OptiDev — account created automatically
### For IT Admins
* New employees get OptiDev access through your IdP (no manual invites)
* Terminated employees lose access immediately when disabled in your IdP
* You control which groups/teams can access OptiDev
***
## Managing Users
Once SSO is enabled, user management happens in your identity provider:
| Task | Where to Do It |
| ------------------ | ---------------------------------------------------- |
| Add a new user | Your identity provider |
| Remove a user | Your IdP — disable or remove from the app |
| Reset password | Your IdP — OptiDev doesn't store passwords |
| Change user's role | OptiDev workspace settings (after they've logged in) |
Users must log in at least once before you can assign them to workspaces or change their role in OptiDev.
***
## Troubleshooting
* Verify the user is assigned to the OptiDev app in your IdP
* Check their email domain matches your SSO-enabled domain
* Confirm SSO is fully configured and tested
* The email domain may not be linked to your SSO setup
* Contact your IT admin to verify domain configuration
* New SSO users need to be added to a workspace after first login
* Ask your workspace admin to invite them
***
## For Developers
### SAML Configuration
* **Protocol**: SAML 2.0
* **SP Entity ID**: `https://auth.optiprime.com/saml/{organization_id}`
* **ACS URL**: `https://auth.optiprime.com/saml/{organization_id}/acs`
* **SP Metadata**: `GET https://auth.optiprime.com/saml/{organization_id}/metadata`
### Supported IdPs
* Any SAML 2.0 compliant provider
### User Provisioning
* JIT (Just-In-Time) provisioning on first login
* Attributes synced: `email`, `firstName`, `lastName`, `displayName`
* Group memberships passed as raw SAML attributes
* Workspace/role mapping configured per-product
### Security
* IdP certificates encrypted at rest (AES-256-GCM)
* SAML assertions validated server-side
* All authentication attempts logged for audit
# SSO Setup: Microsoft Azure AD
Source: https://docs.optidev.ai/security/sso-azure-ad
Configure Azure AD (Entra ID) SAML for OptiDev single sign-on
This guide walks you through setting up Microsoft Azure AD (now called Microsoft Entra ID) as your identity provider for OptiDev SSO.
**Time required:** 15-20 minutes
***
## Overview
You'll complete these steps:
1. Get your OptiDev SSO settings
2. Create an Enterprise Application in Azure
3. Configure SAML settings
4. Set up attribute mappings
5. Download the Azure certificate
6. Enter Azure details in OptiDev
7. Assign users and test
***
## Step 1: Get Your OptiDev SSO Settings
Before creating the Azure app, you need two values from OptiDev.
In OptiDev, go to **Workspace Settings → Security → Single Sign-On**.
You'll see two important values. Keep this page open — you'll need these shortly.
| Setting | Example |
| ---------------- | -------------------------------------------- |
| **SP Entity ID** | `https://auth.optiprime.com/saml/abc123` |
| **ACS URL** | `https://auth.optiprime.com/saml/abc123/acs` |
***
## Step 2: Create an Enterprise Application
Go to [portal.azure.com](https://portal.azure.com) and sign in with your admin account.
Search for **Enterprise Applications** in the top search bar, or navigate to **Azure Active Directory → Enterprise Applications**.
Click **+ New application**.
Click **+ Create your own application**.
* Enter **OptiDev** as the name
* Select **Integrate any other application you don't find in the gallery (Non-gallery)**
* Click **Create**
***
## Step 3: Set Up SAML
In your new OptiDev app, click **Single sign-on** in the left sidebar.
Click **SAML** as the sign-on method.
Click **Edit** on the **Basic SAML Configuration** card.
Fill in these fields:
| Field | Value |
| -------------------------- | --------------------------------------- |
| **Identifier (Entity ID)** | Paste your **SP Entity ID** from Step 1 |
| **Reply URL (ACS URL)** | Paste your **ACS URL** from Step 1 |
| **Sign on URL** | `https://app.optidev.ai` |
Click **Save**.
***
## Step 4: Configure Attribute Mappings
Azure sends user information to OptiDev through SAML attributes. You need to configure what gets sent.
Click **Edit** on the **Attributes & Claims** card.
Make sure these claims exist (add them if missing):
| Claim name | Source attribute |
| -------------- | ---------------- |
| `emailaddress` | `user.mail` |
| `givenname` | `user.givenname` |
| `surname` | `user.surname` |
The default Azure claims usually work. Only edit if you have custom attribute requirements.
The **Unique User Identifier (Name ID)** should be set to `user.userprincipalname` or `user.mail`.
***
## Step 5: Download the Certificate
Scroll to the **SAML Certificates** section.
Next to **Certificate (Base64)**, click **Download**.
Save the file — you'll upload or paste its contents into OptiDev.
In the **Set up OptiDev** section, copy:
| Field in Azure | What You'll Call It |
| ------------------- | ------------------- |
| Login URL | **SSO URL** |
| Azure AD Identifier | **Entity ID** |
***
## Step 6: Enter Azure Details in OptiDev
Go back to **Workspace Settings → Security → Single Sign-On**.
Fill in the fields:
| Field | Value |
| ---------------- | ----------------------------------------------------------------------------------- |
| **Display Name** | `Microsoft` or `Azure AD` (shown on login button) |
| **Entity ID** | Paste the **Azure AD Identifier** |
| **SSO URL** | Paste the **Login URL** |
| **Certificate** | Open the downloaded certificate file in a text editor and paste the entire contents |
Enter your company's email domain (e.g., `yourcompany.com`).
All users with this email domain will be directed to Azure for login.
Click **Save** to enable SSO.
***
## Step 7: Assign Users in Azure
Before users can log in, you need to give them access to the app in Azure.
In your Azure OptiDev app, click **Users and groups** in the sidebar.
Click **+ Add user/group**.
* Click **Users** to select individual people
* Or click **Groups** to assign entire teams
Click **Select**, then **Assign**.
Create a security group called "OptiDev Users" in Azure AD. Add this group to the app, then manage access by adding/removing people from the group.
***
## Step 8: Test Your Setup
Use a private/incognito browser window to avoid cached sessions.
Visit `https://app.optidev.ai` and click **Sign in with SSO**.
Enter your company email address. You should be redirected to Microsoft login.
Sign in with your Microsoft credentials. You should land in OptiDev.
If you see your OptiDev dashboard, SSO is working. Your team can now log in with their Microsoft accounts.
***
## Troubleshooting
The user trying to log in hasn't been assigned to the OptiDev app in Azure.
* Go to **Users and groups** in your Azure app
* Add the user or add them to an assigned group
The Entity ID in OptiDev doesn't match Azure.
* In Azure, go to **Single sign-on → Basic SAML Configuration**
* Verify the **Identifier (Entity ID)** matches exactly what OptiDev shows
* Check that the certificate was copied completely (including `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`)
* Verify the Reply URL (ACS URL) matches exactly
* Make sure there are no extra spaces in the URLs
* The user account was created, but they need to be added to a workspace
* Go to **Workspace Settings → Members** in OptiDev and invite them
If your organization uses multiple email domains (e.g., `company.com` and `company.co.uk`):
* Add each domain in OptiDev SSO settings
* All domains will use the same Azure AD configuration
***
## Optional: Automatic User Provisioning
Want users to appear in OptiDev before they log in? Azure supports SCIM provisioning.
Contact OptiDev support to enable SCIM provisioning for your workspace.
***
## Next Steps
Learn how to add and remove user access.
Common issues and solutions.
# SSO Setup: Okta
Source: https://docs.optidev.ai/security/sso-okta
Configure Okta SAML for OptiDev single sign-on
This guide walks you through setting up Okta as your identity provider for OptiDev SSO.
**Time required:** 15-20 minutes
***
## Overview
You'll complete these steps:
1. Get your OptiDev SSO settings
2. Create a SAML app in Okta
3. Configure the SAML settings
4. Download the Okta certificate
5. Enter Okta details in OptiDev
6. Test the connection
***
## Step 1: Get Your OptiDev SSO Settings
Before creating the Okta app, you need two values from OptiDev.
In OptiDev, go to **Workspace Settings → Security → Single Sign-On**.
You'll see two important values. Keep this page open — you'll need these shortly.
| Setting | Example |
| ---------------- | -------------------------------------------- |
| **SP Entity ID** | `https://auth.optiprime.com/saml/abc123` |
| **ACS URL** | `https://auth.optiprime.com/saml/abc123/acs` |
***
## Step 2: Create a SAML App in Okta
Log in to your Okta admin console at `https://your-domain-admin.okta.com`.
In the sidebar, click **Applications → Applications**.
Click **Create App Integration**.
Choose **SAML 2.0** and click **Next**.
Enter **OptiDev** as the app name. Optionally upload the OptiDev logo. Click **Next**.
***
## Step 3: Configure SAML Settings
On the "Configure SAML" screen, enter these values:
### General Settings
| Field | Value |
| ------------------------------- | --------------------------------------- |
| **Single sign-on URL** | Paste your **ACS URL** from Step 1 |
| **Audience URI (SP Entity ID)** | Paste your **SP Entity ID** from Step 1 |
| **Name ID format** | `EmailAddress` |
| **Application username** | `Email` |
### Attribute Statements
Add these three attribute mappings:
| Name | Value |
| ----------- | ---------------- |
| `email` | `user.email` |
| `firstName` | `user.firstName` |
| `lastName` | `user.lastName` |
Attribute names are case-sensitive. Use lowercase exactly as shown.
Click **Next** when done.
***
## Step 4: Complete App Setup
On the feedback screen:
1. Select **I'm an Okta customer adding an internal app**
2. Click **Finish**
***
## Step 5: Get Okta Details for OptiDev
Now you need to copy values from Okta back to OptiDev.
On your new app's page, click the **Sign On** tab, then click **View SAML setup instructions**.
You'll need three pieces of information:
| From Okta | What It's Called |
| ------------------------------------ | ---------------- |
| Identity Provider Single Sign-On URL | **SSO URL** |
| Identity Provider Issuer | **Entity ID** |
| X.509 Certificate | **Certificate** |
Click to download the certificate. Open it in a text editor — you'll paste the contents into OptiDev.
***
## Step 6: Enter Okta Details in OptiDev
Go back to **Workspace Settings → Security → Single Sign-On**.
Fill in the fields:
| Field | Value |
| ---------------- | ------------------------------------------------------------------------------ |
| **Display Name** | `Okta` (or your company name) |
| **Entity ID** | Paste the Identity Provider Issuer from Okta |
| **SSO URL** | Paste the Single Sign-On URL from Okta |
| **Certificate** | Paste the entire certificate content (including `-----BEGIN CERTIFICATE-----`) |
Enter your company's email domain (e.g., `yourcompany.com`).
All users with this email domain will be directed to Okta for login.
Click **Save** to enable SSO.
***
## Step 7: Assign Users in Okta
Before users can log in, you need to give them access to the app in Okta.
In Okta, open your OptiDev app and click the **Assignments** tab.
Click **Assign** and choose:
* **Assign to People** — for individual users
* **Assign to Groups** — for entire teams or departments
Assigning a group is easier to manage. Create an "OptiDev Users" group and add employees who need access.
***
## Step 8: Test Your Setup
Use a private/incognito browser window to avoid cached sessions.
Visit `https://app.optidev.ai` and click **Sign in with SSO**.
Enter your company email address. You should be redirected to Okta.
Sign in with your Okta credentials. You should land in OptiDev.
If you see your OptiDev dashboard, SSO is working. Your team can now log in with their Okta credentials.
***
## Troubleshooting
* Double-check the **ACS URL** in Okta matches exactly what OptiDev shows
* Verify the certificate was copied completely (including BEGIN/END lines)
* Check that attribute names are lowercase (`email`, not `Email`)
* Go to your Okta app's **Assignments** tab
* Make sure the user (or their group) is assigned to the OptiDev app
* Verify the email domain is correctly configured in OptiDev
* Check that only one SSO configuration exists for this domain
* The user account was created, but they need to be added to a workspace
* Go to **Workspace Settings → Members** and invite them
***
## Next Steps
Learn how to add and remove user access.
Common issues and solutions.