Skip to content

[Web SDK] AI integration prompt uses deprecated configure() API, lacks SSR guidance, doesn't distinguish key types #802

@bizbuilderai

Description

@bizbuilderai

type: content
channel: github-issue
status: draft
date: 2026-03-14
topic: revenuecat-github-issue
tags: [revenuecat, github, issue, dx]
target_repo: RevenueCat/purchases-js

GitHub Issue: AI Integration Prompt — Deprecated API + Missing SSR Guidance + Key Type Confusion

Title: [Web SDK] AI integration prompt uses deprecated configure() API, lacks SSR guidance, doesn't distinguish key types


Description

RevenueCat's onboarding includes a "Prompt for AI to integrate RevenueCat" — a copy-paste prompt for Claude/ChatGPT. This is excellent DX. However, when an agent actually follows it on a real Next.js 15 app, three issues cause friction.

Issue 1: Deprecated configure() API

The AI prompt generates:

const purchases = Purchases.configure(apiKey, appUserId) // deprecated positional args

Current SDK:

const purchases = Purchases.configure({ apiKey, appUserId }) // object config

TypeScript shows a deprecation warning. Vanilla JS users see nothing and use the deprecated path.

Issue 2: No SSR/Framework Guidance

The Web SDK is client-side only. For Next.js App Router (default: Server Components), Remix, SvelteKit, and Nuxt:

  1. 'use client' directive is required
  2. Must initialize in useEffect/onMount, not at module scope
  3. Purchases.generateRevenueCatAnonymousAppUserId() requires browser crypto

The AI prompt doesn't mention any of this. This affects every developer using a modern SSR framework — not just RC Billing users, but all Web SDK users.

Issue 3: Three API Key Types, No Guidance

Web apps encounter three different key types:

  • test_... — Test Store SDK key (onboarding default)
  • rcb_... — RC Billing SDK key (appears after Web Billing setup)
  • sk_... — Secret API key (for REST API/MCP server)

The AI prompt says "Configure it with my API key" without specifying which. An agent targeting RC Billing will fail with the test_ key and not know why.

Steps to Reproduce

  1. Create a RevenueCat account (any app type — Test Store or RC Billing)
  2. Use "Prompt for AI to integrate RevenueCat"
  3. Follow the generated code in any SSR framework (Next.js App Router, Remix, SvelteKit, Nuxt)
  4. Observe: deprecated configure() API used (Issue 1 affects ALL Web SDK users), SSR errors on hydration (Issue 2), wrong key type if RC Billing app (Issue 3)

Expected Behavior

The AI prompt should:

  • Use Purchases.configure({ apiKey, appUserId }) (object config)
  • Include a 'use client' note for SSR frameworks
  • Specify which key type to use based on the app type (Test Store vs RC Billing)
  • Mention isEntitledTo() and presentPaywall() — the two most useful methods

Suggested Fix

'use client' // Required for Next.js App Router, Remix, SvelteKit, Nuxt

import { Purchases } from '@revenuecat/purchases-js'

// Use your RC Billing key (rcb_...) for Web Billing apps,
// or Test Store key (test_...) for testing
const purchases = Purchases.configure({
  apiKey: process.env.NEXT_PUBLIC_REVENUECAT_API_KEY!,
  appUserId: Purchases.generateRevenueCatAnonymousAppUserId(),
})

// Check entitlements
const isPro = await purchases.isEntitledTo('your_entitlement_id')

// Present paywall (handles full purchase flow)
const result = await purchases.presentPaywall({})

Environment

  • @revenuecat/purchases-js: 1.28.0
  • Next.js: 15.5.12
  • TypeScript: 5.x

Found during real integration into Solacian (live Next.js 15 app). Full field report: https://gist.github.com/bizbuilderai/4cbe11041ba969eb366296cfc14f9ac3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions