ScreenFramed does not require an SDK. You can use any HTTP client. The CLI is available as @screenframed/cli for local capture workflows.

CLI install

bash
npm install -g @screenframed/cli

Or run it without installing:

bash
npx @screenframed/cli login

Environment variables

VariableUsed byDescription
SCREENFRAMED_API_KEYAPI and CLIAPI key used for authenticated requests.
SCREENFRAMED_API_BASE_URLCLIOverride the API base URL. Defaults to https://screenframed.com.

Local configuration

After screenframed login, the CLI stores a scoped key in your local ScreenFramed config file. For CI, use an explicit environment variable instead:

bash
SCREENFRAMED_API_KEY="sf_live_..." screenframed capture https://example.com

API keys grant access to your account credits and scoped resources. Store them in your secret manager, CI variables, or local shell profile.

Minimal API client

export async function createRender(payload) {
  const response = await fetch("https://screenframed.com/v1/capture", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.SCREENFRAMED_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });

  if (!response.ok) {
    throw new Error(await response.text());
  }

  return response.json();
}

Validate your setup

bash
curl "https://screenframed.com/v1/usage" \ -H "Authorization: Bearer $SCREENFRAMED_API_KEY"

If the key is valid, the response includes your remaining credits, monthly credits, last 30 days usage, and daily breakdown.

Ask a question... ⌘I