Logokeyset
  • Product
  • Pricing
  • Docs
  • Contact
LoginGet Started
keyset
Navigation
  • Product
  • Pricing
  • Docs
  • Contact
Login to AccountGet Started Free
keyset

A powerful configuration and content management system for modern applications.

Product

  • Features
  • Pricing
  • Use Cases
  • Documentation

Company

  • About
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

Follow Us

TwitterGitHub

© 2026 Keyset. All rights reserved.

Logokeyset
  • Product
  • Pricing
  • Docs
  • Contact
LoginGet Started
keyset
Navigation
  • Product
  • Pricing
  • Docs
  • Contact
Login to AccountGet Started Free
Docs/Reference/Content API
Getting Started
Reference
  • Configuration
  • Content API
  • React Integration
  • TypeScript Types
Guides

Content API

All content methods live on client.content. They are all async and return a Promise.

TypeScript
import { Keyset } from "keysetapp";

const client = new Keyset({ apiKey: "pkey_…", cacheTTL: 60000 });

Read methods

getAll(options?)

Fetches all remote config entries as a flat key-value map.

TypeScript
const data = await client.content.getAll();
// { hero_title: "Welcome", show_banner: true, max_retries: 3 }

Pass { typed: true } to receive the full typed response (includes type metadata per entry):

TypeScript
const typed = await client.content.getAll({ typed: true });
// {
//   hero_title: { value: "Welcome", type: "string" },
//   show_banner: { value: true, type: "boolean" },
// }

Signature

TypeScript
getAll(options?: { typed?: boolean }): Promise<Record<string, unknown> | TypedContentResponse>

Caching — responses are cached under the key "content" (or "content:typed" when typed: true). Cache is shared across calls.


getTypedAll()

Shorthand for getAll({ typed: true }). Returns the full typed response.

TypeScript
const all = await client.content.getTypedAll();
// Record<string, { value: unknown; type: ContentType }>

Signature

TypeScript
getTypedAll(): Promise<TypedContentResponse>

getTyped(key)

Returns the typed entry for a single key, or null if it does not exist.

TypeScript
const entry = await client.content.getTyped("hero_title");
// { value: "Welcome", type: "string" } | null

Signature

TypeScript
getTyped(key: string): Promise<TypedContentEntry | null>

getString(key, defaultValue?)

Returns the string value for a key. Accepts entries of type string, url, or image. Falls back to defaultValue (default "") if the key is missing or has the wrong type.

TypeScript
const title = await client.content.getString("hero_title", "Default Title");

Signature

TypeScript
getString(key: string, defaultValue?: string): Promise<string>

getNumber(key, defaultValue?)

Returns the numeric value for a key. Falls back to defaultValue (default 0).

TypeScript
const limit = await client.content.getNumber("max_results", 10);

Signature

TypeScript
getNumber(key: string, defaultValue?: number): Promise<number>

getBoolean(key, defaultValue?)

Returns the boolean value for a key — ideal for feature flags. Falls back to defaultValue (default false).

TypeScript
const enabled = await client.content.getBoolean("dark_mode", false);

if (enabled) {
  enableDarkMode();
}

Signature

TypeScript
getBoolean(key: string, defaultValue?: boolean): Promise<boolean>

getJSON<T>(key, defaultValue?)

Returns the parsed JSON value for a key, typed as T. Falls back to defaultValue (default null).

TypeScript
interface NavLink { label: string; href: string }

const links = await client.content.getJSON<NavLink[]>("nav_links", []);

Signature

TypeScript
getJSON<T>(key: string, defaultValue?: T | null): Promise<T | null>

getURL(key, defaultValue?)

Returns the URL string for a key (type must be "url"). Falls back to defaultValue (default "").

TypeScript
const docsUrl = await client.content.getURL("docs_url", "https://docs.example.com");

Signature

TypeScript
getURL(key: string, defaultValue?: string): Promise<string>

getImage(key, defaultValue?)

Returns the image URL string for a key (type must be "image"). Falls back to defaultValue (default "").

TypeScript
const logoUrl = await client.content.getImage("logo_url", "/default-logo.png");

Signature

TypeScript
getImage(key: string, defaultValue?: string): Promise<string>

Write methods

Note

Requires a secret key (skey_…). Calling any write method with a public key throws "This operation requires a secret key".

create(entry)

Creates a new content entry.

TypeScript
await client.content.create({
  key: "promo_banner",
  value: "Summer sale — 20% off",
  type: "string",
});

Signature

TypeScript
create(entry: ContentEntry): Promise<KeysetResponse<unknown>>
FieldTypeDescription
keystringUnique identifier for the entry
valueunknownThe value to store
typeContentTypeOne of "string", "number", "boolean", "json", "url", "image"

Cache — invalidates both "content" and "content:typed" cache keys on success.


update(key, entry)

Updates an existing content entry by key.

TypeScript
await client.content.update("promo_banner", {
  value: "Winter sale — 30% off",
  type: "string",
});

Signature

TypeScript
update(key: string, entry: Omit<ContentEntry, "key">): Promise<KeysetResponse<unknown>>

Cache — invalidates both cache keys on success.


delete(key)

Deletes a content entry by key.

TypeScript
await client.content.delete("promo_banner");

Signature

TypeScript
delete(key: string): Promise<KeysetResponse<unknown>>

Cache — invalidates both cache keys on success.


dashboardList(projectId)

Returns all content entries for a project in the full dashboard format (includes id, createdAt, updatedAt). Intended for admin dashboards.

TypeScript
const entries = await client.content.dashboardList("proj_abc123");

Signature

TypeScript
dashboardList(projectId: string): Promise<KeysetResponse<DashboardContentEntry[]>>

Requires a secret key.


Content types at a glance

ContentTypeTypeScript typeGetter method
"string"stringgetString
"number"numbergetNumber
"boolean"booleangetBoolean
"json"T (generic)getJSON<T>
"url"stringgetURL
"image"stringgetImage
PreviousConfiguration
NextReact Integration

Use with AI

Copy the full Keyset SDK reference as a ready-to-use AI prompt. Paste it into any AI tool to get instant, accurate integration help.

Resources

  • FAQ
  • Privacy Policy
keyset

A powerful configuration and content management system for modern applications.

Product

  • Features
  • Pricing
  • Use Cases
  • Documentation

Company

  • About
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

Follow Us

TwitterGitHub

© 2026 Keyset. All rights reserved.