# SDK (/docs/sdk)



The SDK integration is the best option when you want to display EarlySEO articles on a custom frontend (Next.js, React, or any headless setup).

When you publish an article in EarlySEO, it becomes instantly available to your site via the SDK. Your frontend fetches article data using `@earlyseo/blog`.

When to use SDK [#when-to-use-sdk]

Use SDK when:

* You want full control over design and routing
* You use Next.js App Router or custom React frontends
* You do not want direct CMS publishing

Do not use SDK when:

* You want direct publishing into WordPress/Webflow/Shopify admin
* Your team relies on CMS-native editorial workflows only

Setup [#setup]

1. Create integration in EarlySEO [#1-create-integration-in-earlyseo]

1. Open **EarlySEO Dashboard -> Integrations**
2. Click **Add Integration**
3. Choose **SDK (@earlyseo/blog)**
4. Set publish mode to **Publish** (recommended)
5. Save integration

2. Copy your Site ID [#2-copy-your-site-id]

After creating SDK integration, copy the Site ID from your site settings or integration panel.

3. Install SDK package [#3-install-sdk-package]

**JavaScript / TypeScript:**

```bash
npm install @earlyseo/blog
```

**Python:**

```bash
pip install earlyseo-blog
```

4. Add env variable [#4-add-env-variable]

```bash
EARLYSEO_SITE_ID=your-site-id
```

Automatic setup (optional) [#automatic-setup-optional]

Skip manual steps 3–5 with the CLI scaffolds:

```bash
# Next.js — creates blog pages and .env.local
npx @earlyseo/blog init

# Django / Flask — detects framework, generates templates and .env
earlyseo-blog
```

5. Implement frontend pages [#5-implement-frontend-pages]

**JavaScript / TypeScript:**

* [Next.js SDK Guide](/docs/next-sdk) — App Router with `npx @earlyseo/blog init` CLI scaffold
* [React SDK Guide](/docs/react-sdk) — Vite, Remix, or any SPA

**Python:**

* [Django SDK Guide](/docs/django-sdk) — views, URLs, template tags
* [Flask SDK Guide](/docs/flask-sdk) — blueprint, Jinja templates
* [Python SDK Overview](/docs/python-sdk) — standalone client, async, CLI

6. Add sitemap (recommended) [#6-add-sitemap-recommended]

Adding blog articles to your sitemap helps search engines discover and index your content faster.

* [SDK Sitemap Guide](/docs/sdk-sitemap) — Next.js, Django, and Flask sitemap setup

Verify setup [#verify-setup]

1. Publish one article from EarlySEO dashboard
2. Open your frontend `/blog`
3. Confirm article list appears
4. Open one article URL and verify content renders correctly

Troubleshooting [#troubleshooting]

For a full checklist, see [SDK Troubleshooting](/docs/sdk-troubleshooting).

**No articles showing**

* Confirm `EARLYSEO_SITE_ID` is correct
* Confirm article was published (not draft)
* Confirm SDK integration exists and is active

**404 on article page**

* Check slug in URL matches published article slug
* Republish article once to refresh content

**Styles look off**

* Use default styled mode first
* Then apply custom theming from [Article Theming](/docs/article-theming)
