First steps
Quickstart
Authenticate, install the SDK, and generate your first app from code in under 60 seconds.
#Prerequisites
- A PromptFloe account on Basic or higher.
- Node 18+ (TypeScript), Python 3.9+, or Go 1.21+.
- A workspace API key — generated from
/settings/api.
#Install the SDK
Install
npm install @promptfloe/sdk#Set up your API key
Generate a workspace API key from /settings/api. Keys are tied to a workspace and inherit its tier permissions. Store the key in an environment variable — never commit it.
.env
PROMPTFLOE_API_KEY=pf_live_********************************#Generate your first app
1
Construct the client
import { PromptFloe } from '@promptfloe/sdk';
const client = new PromptFloe({
apiKey: process.env.PROMPTFLOE_API_KEY,
});2
Kick off a build
const stream = client.apps.generateStream({
prompt: 'A pricing page for a CRM SaaS targeting small agencies',
template: 'saas-ai-landing',
augmenters: ['seo', 'a11y'],
});
for await (const event of stream) {
if (event.type === 'plan') console.log('plan', event.summary);
if (event.type === 'file') console.log('wrote', event.path);
if (event.type === 'ready') console.log('preview', event.previewUrl);
if (event.type === 'error') throw new Error(event.message);
}3
Run a skill against the new app
const report = await client.skills.run({
alias: 'roast',
appId: app.id,
});
console.log(report.markdown);4
Deploy
const deploy = await client.deployments.create({
appId: app.id,
provider: 'netlify',
});
console.log('live at', deploy.url);#Where to go next
PromptFloe developer docs