RankPine docs
Integrations

Replit via webhook

Add a signed RankPine route to an existing Replit App, keep the secret in Replit Secrets, and publish with persistent storage.

Replit connects to RankPine via webhook. You add one route to the server that already powers your Replit App and connect its URL through RankPine's existing Webhook / REST integration.

Before you start

  • Use an Autoscale or Reserved VM-style published app with server routes. Replit Secrets are not available to Static Deployments, and a static site cannot receive this webhook.
  • Use Replit Database or another persistent database. The published filesystem is not persistent and an in-memory map will lose articles on restart.
  • Decide the public article route and sitemap source.

Replit documents encrypted app secrets under All tools → Secrets, Git provider imports for existing projects, and publication from the Publish pane. See the official guides for Secrets, importing a repository, and Publishing.

1. Add the receiver route

Download the shared RankPine receiver template and place it in the server-side source tree. Mount it at a route such as POST /api/rankpine/webhook, using the framework already in the Replit App.

The adapter must upsert by article.id, retain every field passed to it, return a stable ID and public URL, and synchronously refresh or invalidate the app's sitemap/content index before acknowledging the delivery.

Copy-paste build instruction

Add RankPine to this existing Replit App via one secure webhook route. First inspect the current framework, database, article model, routing, and sitemap. Preserve all unrelated behavior and use the existing stack instead of introducing a second web framework or database.

Add https://rankpine.com/docs/templates/rankpine-webhook-receiver.ts to server-only code and mount it at POST /api/rankpine/webhook (or the closest existing route convention). Read RANKPINE_WEBHOOK_SECRET from Replit Secrets. Verify HMAC against the exact raw request body before parsing, reject stale/future requests outside five minutes, validate the event and payload, and keep the secret out of browser bundles and logs.

Persist articles in the existing durable database, never the local filesystem or process memory. Add a unique RankPine article ID and upsert by it. Preserve title, slug, HTML, Markdown, metadata, featured and inline images, and scheduledFor. Return stable { id, url }. Make refreshSitemap update or invalidate the sitemap/content index this app actually serves, and fail the request if that critical refresh fails so RankPine can retry idempotently.

Add focused tests for raw-body signature verification, freshness, invalid payloads, and same-ID updates. Tell me the exact route URL after publication and the deployment type required. Do not publish or change unrelated code.

2. Store the secret

  1. Open All tools → Secrets in the Replit Project Editor.
  2. Add an app secret named RANKPINE_WEBHOOK_SECRET.
  3. Check the Publishing pane before release and make sure the production deployment receives that secret. Replit's current secret flow syncs values, but an explicitly unsynced production override can differ.

3. Publish and copy the endpoint

  1. Choose Publish and use a deployment type that runs the server.
  2. Confirm the app listens on Replit's expected host/port and completes its health check.
  3. Copy the published HTTPS domain and append the route, for example:
https://your-app.replit.app/api/rankpine/webhook

Use the deployment URL, not the temporary replit.dev workspace URL.

4. Connect via webhook in RankPine

Open Settings → Integrations → Website builders via webhook → Replit, choose Connect via webhook, and enter the published endpoint plus the same secret. Keep HTML and Markdown enabled. The verification event should return 200.

5. Verify create and update

Publish a test article and confirm one durable database record, the returned public URL, and the sitemap entry. Edit and republish that same RankPine article; the record count must remain one while its content changes. Restarting or republishing the Replit App must not remove the article.

On this page