Skip to Content
AI Integration ✨

AI Integration

Feed this file to your AI assistant and it will understand the entire Hira SDK — then you just describe what flow you want and the AI generates the code.

How to use

  1. Download the AI context file below
  2. Add it to your AI assistant:
    • Cursor → Add to .cursorrules or Project Rules
    • ChatGPT → Upload as file in a new chat
    • Claude → Add to Project Knowledge
    • GitHub Copilot → Add to .github/copilot-instructions.md
  3. Prompt the AI:
Write me a flow to login to Facebook: - Open URL facebook.com - Enter email, password from profileInput - Click the login button - Wait for page to load - Check if login was successful - Write output: loginStatus, userName

The AI will generate a complete flow with correct types, imports, and patterns.

Download

đź“„ Open hira-sdk-ai-rules.md

[!TIP] Open the file → Select All (Ctrl+A) → Copy (Ctrl+C) → Paste into your AI assistant. Or right-click the link → “Save link as…” to download.

What’s inside?

The AI context file includes:

SectionContent
ImportsAll exports from @hira-core/sdk
AntidetectProviderGPM, Hidemium, GenLogin, AdsPower
defineFlowConfig()Input types, output schema, validation rules
Flow ClassAntidetectBaseFlow, constructor, script()
IScriptContextbrowser, page, profile, globalInput, profileInput, output, logger
BrowserUtilsAll 21 methods with full signatures, parameters, defaults, and examples
ExcelStorageSetup at runner level, column mapping, parseProfileSettings
Dev RunnerComplete main.dev.ts template
Complete ExampleFull login flow with error handling + popup pattern
Project StructureSingle flow + multi-flow with versioning
Key Rules18 rules AI must follow

Example: What AI generates

After feeding the context file, you can prompt:

“Write a flow to scrape product info from shopee.vn — get name, price, rating, and write to output”

The AI will generate:

import { AntidetectBaseFlow, AntidetectProvider, BrowserUtils, FlowLogger, IScriptContext, defineFlowConfig, } from '@hira-core/sdk' const config = defineFlowConfig({ globalInput: [ { key: 'productUrl', label: 'Product URL', type: 'text', required: true }, ], profileInput: [], output: [ { index: 0, key: 'productName', label: 'Product Name' }, { index: 1, key: 'price', label: 'Price' }, { index: 2, key: 'rating', label: 'Rating' }, ], }) type Config = typeof config export class ShopeeScraperFlow extends AntidetectBaseFlow<Config> { constructor(provider: AntidetectProvider = AntidetectProvider.GPM) { super(provider, new FlowLogger('ShopeeScraperFlow'), config) } async script(context: IScriptContext<Config>) { const browser = new BrowserUtils(context) await browser.goto(context.globalInput.productUrl) await browser.sleep(3000) // wait for dynamic content const name = await browser.getText('.product-title') const price = await browser.getText('.product-price') const rating = await browser.getText('.product-rating') await browser.writeOutput('productName', name ?? 'N/A') await browser.writeOutput('price', price ?? 'N/A') await browser.writeOutput('rating', rating ?? 'N/A') } }

✅ Correct imports, types, patterns — all generated automatically!

Last updated on