Create a temporary app that expires after two hours. Use the client from Client setup, and replace your-workspace with your workspace name.
perishable.jsperishable.py
const deployment = await client.deployments.create({
appName: "perishable-app",
owner: "your-workspace",
files: { "index.html": "<h1>This app will perish in two hours</h1>" },
perishAt: "PT2H", // ISO 8601 duration
});
const appVersion = await deployment.wait({
onProgress: (event) => console.log(event.stream, event.message),
});
console.log(appVersion.app.url, appVersion.app.willPerishAt);deployment = client.deployments.create(
app_name="perishable-app",
owner="your-workspace",
files={"index.html": "<h1>This app will perish in two hours</h1>"},
perish_at="PT2H", # ISO 8601 duration
)
app_version = deployment.wait(
on_progress=lambda event: print(event.stream, event.message),
)
print(app_version.app.url, app_version.app.will_perish_at)Source: stackmachine/sdks examples.