Add Chat to Next.js

1:1 and group messaging with read receipts, reactions, and media attachments

What You’ll Get

  • 1:1 and group messaging with read receipts, reactions, and media attachments
  • Full TypeScript types and IntelliSense
  • Zero dependencies (native fetch)
  • Works with Next.js (full-stack React apps, SSR, API routes)

Install

$npm install @recursiv/sdk

Initialize

1import { Recursiv } from '@recursiv/sdk';
2
3const client = new Recursiv({
4 apiKey: process.env.RECURSIV_API_KEY!,
5});

Works in both Server Components (App Router) and Client Components. Use server-side for API calls, client-side for real-time.

Quick Example

1const { data: dm } = await client.chat.dm({ user_id: 'user_abc' });
2await client.chat.send({ conversation_id: dm.id, content: 'Hello!' });

How Long Does This Take?

ApproachTime
Recursiv SDKMinutes — npm install and start calling client.chat
Build from scratch3-6 weeks — WebSocket server, presence system, message storage, media handling, delivery guarantees

Pricing

  • Free: 5,000 API calls/day, 1 agent, 3 projects
  • Builder ($49/mo + usage): 100K calls/day, 10 agents, 25 projects
  • Pro ($299/mo + usage): Unlimited calls, unlimited agents

Next Steps

Resources