Skip to integration guide
ProviderDock

PrayWithMe.faith production integration guide

Connect Prayer Companion through ProviderDock

Keep the existing Prayer Companion endpoint and fallback behavior while ProviderDock securely owns provider credentials, routing, failover, limits, tracing, and metering.

Tenant and providerSDK setupServer routeProduction validation
1. Tenant setup2. SDK configuration3. Route migration4. Production checks
1

WORKSPACE CONFIGURATION

Create the tenant and provider connection

  1. Create a production tenant.Use a stable identifier such as praywithme-faith-production.
  2. Add the approved provider credentials.Use the ProviderDock console connection form so credentials stay outside the PrayWithMe.faith application.
  3. Create the smallest possible API token.Grant only the gateway:invoke scope and store the token in the server secret manager.
2

SDK CONFIGURATION

Install and configure the server SDK

npm install provider-dock
PROVIDERDOCK_API_KEY=pd_live_…
PROVIDERDOCK_MODEL=gpt-4.1-mini

Add these values only to the PrayWithMe.faith server environment. Never expose the token through a NEXT_PUBLIC_ variable or browser bundle.

3

SERVER ROUTE

Replace the direct provider client

The browser continues calling the existing Prayer Companion route. Only the server-side provider call changes.

import ProviderDock from "provider-dock";
import { NextResponse } from "next/server";

const providerDock = process.env.PROVIDERDOCK_API_KEY
  ? new ProviderDock({ apiKey: process.env.PROVIDERDOCK_API_KEY })
  : null;

export async function POST(request: Request) {
  const { message } = await request.json();

  if (!providerDock) {
    return NextResponse.json({ result: fallbackPrayerResponse(message) });
  }

  const response = await providerDock.responses.create({
    model: process.env.PROVIDERDOCK_MODEL ?? "gpt-4.1-mini",
    instructions: prayerCompanionSystemPrompt,
    input: "Someone shared this prayer need. Respond with the requested JSON only. Prayer need: " + message,
    temperature: 0.6,
    max_output_tokens: 900
  });

  return NextResponse.json({ result: response.output_text });
}
4

PRODUCTION VALIDATION

Verify the complete Prayer Companion path

  • Send a test prayer request from an isolated staging deployment.
  • Confirm the ProviderDock console records request metadata without storing prayer text.
  • Verify response behavior, latency, rate limits, failover, and devotional safeguards.
  • Keep the existing fallback path behind a temporary rollback flag until production behavior is stable.

Privacy boundary

ProviderDock meters operational metadata such as model, tokens, status, and latency. It does not persist the Prayer Companion prompt or response body.

Open the ProviderDock consoleOpen SDK documentation
ProviderDock v0.15.5•Accessibility