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.
WORKSPACE CONFIGURATION
Create the tenant and provider connection
- Create a production tenant.Use a stable identifier such as
praywithme-faith-production. - Add the approved provider credentials.Use the ProviderDock console connection form so credentials stay outside the PrayWithMe.faith application.
- Create the smallest possible API token.Grant only the
gateway:invokescope and store the token in the server secret manager.
SDK CONFIGURATION
Install and configure the server SDK
npm install provider-dockPROVIDERDOCK_API_KEY=pd_live_…
PROVIDERDOCK_MODEL=gpt-4.1-miniAdd these values only to the PrayWithMe.faith server environment. Never expose the token through a NEXT_PUBLIC_ variable or browser bundle.
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 });
}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.