# Integrate the frontend. Keep your stack.

ContentEdge is the platform behind the project. Your application renders the experience. Two SDKs cover the usual integration: reading published content, and submitting public newsletter or enquiry forms from the browser.

## How a frontend talks to ContentEdge.

- **Your application — The interface.** Build the site or app in the technology you already use. ContentEdge does not replace the frontend.
- **SDKs — Two clear paths.** CMS SDK for published content. Newsletter SDK for public forms. Each call names the tenant.
- **ContentEdge — The tenant.** Content, files, subscribers, and form configuration stay inside that tenant on the platform.

## Read published content.

`@codesocietyou/contentedge-cms-sdk` uses a content API key. Initialise it once, then fetch a content type for the tenant. Omit `sortBy` to follow the order set in the admin.

```js
import { createApiClient, fetchContentByType } from "@codesocietyou/contentedge-cms-sdk";

createApiClient({
  baseUrl: "https://api.contentedgecms.com",
  apiKey: "your-content-api-key",
  tenant: "company",
});

const news = await fetchContentByType({
  type: "NEWS",
  page: 0,
  size: 10,
});
```

[CMS SDK documentation](https://contentedgecms.com/docs/cms-sdk)

## Browser-safe public forms.

`@codesocietyou/contentedge-newsletter-sdk` submits subscriptions and enquiries with a tenant and a form key. The browser does not receive newsletter API keys. Lists, templates, and recipients stay in ContentEdge.

```js
import { createNewsletterClient } from "@codesocietyou/contentedge-newsletter-sdk";

const newsletter = createNewsletterClient({
  baseUrl: "https://api.contentedgecms.com",
  tenant: "company",
  formKey: "homepage-newsletter",
});

await newsletter.subscribe({
  email: "reader@example.com",
  consent: true,
  captchaToken,
});
```

[Newsletter SDK documentation](https://contentedgecms.com/docs/newsletter-sdk)

## The same shape on the next project.

### Predictable APIs

Content lists, single records, and public form actions have a stable contract. The project maps its own fields on top.

### SDK support

TypeScript clients for content delivery and for public newsletter forms. Documentation lives with the product.

### Tenant isolation

The tenant argument is part of the call. One project's content and subscribers are not another project's data.

### Reusable project infrastructure

A new implementation starts from the platform: tenant, content API, and public forms, instead of a new backend.

### Browser-safe newsletter integration

Public pages submit form fields, consent, and a captcha token. Sending configuration never ships to the browser.

### Your frontend

The SDKs are clients. Use them from the stack you prefer. ContentEdge does not prescribe the interface.

Tenant app sign-in is a separate, advanced path. Use it only when a project needs it. The setup is documented on the [ContentEdge identity docs](https://contentedgecms.com/docs/identity).
