Step 1 of 3
Your Code
Real Next.js code that AI helped you write
Code
// app/api/chat/route.ts
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: 'sk-ant-api03-xK9mR2vL8nP4qW1tY6uI0oA3sD5fG7hJ9kL2zX4cV6bN8m',
});
export async function POST(req: NextRequest) {
const { message } = await req.json();
const response = await client.messages.create({
model: 'claude-sonnet-4-5',
max_tokens: 1024,
messages: [{ role: 'user', content: message }],
});
return NextResponse.json({ reply: response.content[0].text });
}
// app/api/users/route.ts - Search endpoint
export async function GET(req: NextRequest) {
const query = req.nextUrl.searchParams.get('q') || '';
const { data } = await supabase
.rpc('search_users', { search_query: query });
return NextResponse.json(data);
}
// next.config.js - "make these available in the browser"
const nextConfig = {
env: {
DATABASE_URL: process.env.DATABASE_URL,
STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,
},
};👀
Ready to scan?
Click "Next" to see what ShipSafe finds
Ready to secure your code?
Connect your GitHub and scan your entire codebase in under 2 minutes.
Get Started Free