Skip to the page

Connect your site

Connect any custom site with a webhook (Lovable, Bolt, v0, Next.js)

If your site isn't WordPress, Blogger, Ghost or Shopify, Publizo can send each finished article to an address on your own site as JSON. Your site saves it as a blog post. This is the way to add an SEO blog to a site built with Lovable, Bolt, v0 or Next.js.

Have this ready

  • A site that can run a small backend endpoint (any API route or serverless function)
  1. 1

    Build the receiving endpoint

    Your site needs one HTTPS address that accepts POST requests. If your site was built with an AI builder like Lovable, Bolt or v0, paste this request into it:

    Add a blog to this site that receives posts from Publizo.
    1. Create a posts table: title, slug, html, excerpt, tags, feature_image, status, created_at.
    2. Create a public HTTPS endpoint (for example /api/publizo or a backend function) that accepts POST requests with JSON.
    3. If the JSON has "event": "publizo.ping", reply 200 with {"ok": true}.
    4. If it has "event": "article.published", read "article" (title, html, excerpt, tags, feature_image, status) and save it as a post. Make a slug from the title.
    5. Check the X-Publizo-Signature header: it is "sha256=" plus the HMAC SHA256 (hex) of "<X-Publizo-Timestamp>.<raw body>" using a secret stored as PUBLIZO_SECRET. Reject requests where it doesn't match.
    6. Reply with {"url": "<public address of the new post>"}.
    7. Add /blog (list of posts) and /blog/:slug (one post, rendering the html) pages with proper titles and meta descriptions.
    Tell me the endpoint address when you're done.
  2. 2

    Or write it yourself

    Publizo sends JSON with event and sent_at. A test sends event "publizo.ping". Each article sends event "article.published" with article: title, html, excerpt, tags, feature_image, status and focus_keyword. Reply with any 2xx status, and optionally {"url": "…"} so Publizo can link to the live post. A Next.js example:

    // Next.js (App Router): app/api/publizo/route.ts
    import crypto from "crypto";
    
    export async function POST(req: Request) {
      const body = await req.text();
      const ts = req.headers.get("x-publizo-timestamp") ?? "";
      const sig = req.headers.get("x-publizo-signature") ?? "";
      const expected = "sha256=" + crypto
        .createHmac("sha256", process.env.PUBLIZO_SECRET!)
        .update(`${ts}.${body}`)
        .digest("hex");
      if (sig !== expected) return new Response("bad signature", { status: 401 });
    
      const data = JSON.parse(body);
      if (data.event === "publizo.ping") return Response.json({ ok: true });
    
      const a = data.article; // title, html, excerpt, tags, feature_image, status, focus_keyword
      // Save it to your own posts table here, then return its public address:
      return Response.json({ url: "https://yoursite.com/blog/your-new-post" });
    }
  3. 3

    Pick a signing secret

    Make up a long random text and store it on your site (for example as PUBLIZO_SECRET). With a secret set, every request carries X-Publizo-Timestamp and X-Publizo-Signature: "sha256=" plus the HMAC SHA256 of "timestamp.body". Checking it means only Publizo can post to your blog.

  4. 4

    Add the webhook in Publizo

    In Add site choose Custom site, enter the endpoint address (it must start with https://) and the same secret. Click Test Connection: Publizo sends the ping and your endpoint must answer 2xx. Then click Connect Site.

If something goes wrong

Each problem says whose side it is on, so you know where to fix it.

Your setup

"Webhook address must start with https://"

Use the secure https address of your endpoint.

Your site or host

"Your webhook answered with status …"

Your endpoint must reply 2xx to the ping. Check its logs: a 401 usually means the signature check uses a different secret, a 404 means the address is wrong.

Your site or host

"Could not reach your webhook address"

Check the site is deployed and the endpoint is public.

Still stuck? Email support@publizo.io with your site address and the exact message you see.