# Create .env file in functions directory
echo "OPENAI_API_KEY=your-openai-key-here" > functions/.envnpm install
cd functions && npm cinpm run emulators
# or clean start:
npm run emulators:clean- Functions: http://localhost:5001
- Firestore: http://localhost:9081
- Emulator UI: http://localhost:4001
$body = @{
rawText = "handmade wooden ring box"
uid = "testuser123"
runId = "demo"
maxRetries = 1
} | ConvertTo-Json
Invoke-RestMethod `
-Uri "http://localhost:5001/etsy-ai-hacker/us-central1/generateFromDumpCore" `
-Method Post `
-ContentType "application/json" `
-Body $body{
"success": true,
"fields": {
"title": "Handmade Wooden Ring Box...",
"tags": ["ring box", "wooden jewelry", ...],
"description": "Perfect for storing your precious rings..."
}
}- Emulator UI: http://localhost:4001/firestore
- Path:
runs > [runId] > logs - Per-field logs: tokens_in, tokens_out, retry_count, model
- Console logs appear in emulator terminal
- Error details in
firebase-debug.log
# Clean restart emulators
npm run emulators:clean
# Run tests
npm test
# Check vulnerabilities
npm audit
# Fix vulnerabilities
npm audit fixIf emulators fail to start:
taskkill /f /im node.exe
taskkill /f /im java.exeEnsure generateFromDumpCore is properly exported in functions/index.js
Verify OPENAI_API_KEY is set in functions/.env