import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({ type: "android" });
// Take full screenshot
const screenshot = await box.action.screenshot({
outputFormat: "base64"
});
// Take screenshot with clip
const clippedScreenshot = await box.action.screenshot({
clip: {
x: 100,
y: 50,
width: 800,
height: 600
}
});
}
main();
{
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}
import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({ type: "android" });
// Take full screenshot
const screenshot = await box.action.screenshot({
outputFormat: "base64"
});
// Take screenshot with clip
const clippedScreenshot = await box.action.screenshot({
clip: {
x: 100,
y: 50,
width: 800,
height: 600
}
});
}
main();
{
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}
Enter your API Key in the format: Bearer <token>. Get it from https://gbox.ai
Box ID
"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"
Screenshot capture action configuration
Result of screenshot capture action
Was this page helpful?