Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.edgespark.dev/llms.txt

Use this file to discover all available pages before exploring further.

secret reads values from your project’s encrypted secret store. Secrets are scoped to the current environment. For newly created projects today, that means the current default production environment.
Secret values are not pasted into the CLI. edgespark secret set opens a secure EdgeSpark browser URL so the human owner can enter the value directly, without sending it through the terminal, agent context, or third-party LLM APIs such as Anthropic, Google, or OpenAI.

secret.get(name)

Declare the key in server/src/defs/runtime.ts, then read it at runtime:
server/src/index.ts
import { secret } from "edgespark";
import { Hono } from "hono";

const app = new Hono().post("/api/send-email", async (c) => {
  const { to, subject, body } = await c.req.json<{
    to: string;
    subject: string;
    body: string;
  }>();

  const apiKey = secret.get("SENDGRID_API_KEY");

  await fetch("https://api.sendgrid.com/v3/mail/send", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${apiKey}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      personalizations: [{ to: [{ email: to }] }],
      from: { email: "no-reply@yourapp.com" },
      subject,
      content: [{ type: "text/plain", value: body }],
    }),
  });

  return c.json({ sent: true });
});

export default app;

Manage secrets

Use the CLI to manage secret keys:
edgespark secret list
edgespark secret set SENDGRID_API_KEY
edgespark secret delete SENDGRID_API_KEY
edgespark secret set opens a secure project URL where the value is entered in the browser.

See also

Manage secrets

How to register keys, enter values securely, and use different values per environment.

Development workflow

How secrets fit into the full repo-based workflow for schema, storage, vars, auth config, and deploys.
Last modified on April 7, 2026