A smarter clipboard built specifically for developers and AI workflow. Store, organize, and reuse your most important code snippets with ease.
Free to start, $4.99/month for Pro features
30-day money-back guarantee • No credit card required
Experience how Copy Companion helps you manage code snippets.
// Process a refund via Stripe API export async function processRefund( paymentIntentId: string, amount?: number ): Promise<{ success: boolean; data?: any; error?: string }> { try { const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY); const refundParams: any = { payment_intent: paymentIntentId, }; // If amount is specified, add it to refund params if (amount) { refundParams.amount = amount; // Amount in cents } const refund = await stripe.refunds.create(refundParams); return { success: true, data: refund }; } catch (error: any) { console.error('Refund processing error:', error.message); return { success: false, error: error.message }; } }
// Create a new subscription with Stripe export async function createSubscription( customerId: string, priceId: string, trialDays = 0 ): Promise<{ success: boolean; data?: any; error?: string }> { try { const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY); // Subscription parameters const subscriptionParams: any = { customer: customerId, items: [{ price: priceId }], payment_behavior: 'default_incomplete', payment_settings: { save_default_payment_method: 'on_subscription' }, expand: ['latest_invoice.payment_intent'], }; // Add trial period if specified if (trialDays > 0) { subscriptionParams.trial_period_days = trialDays; } const subscription = await stripe.subscriptions.create(subscriptionParams); return { success: true, data: { subscriptionId: subscription.id, clientSecret: subscription.latest_invoice.payment_intent.client_secret, }, }; } catch (error: any) { console.error('Subscription creation error:', error.message); return { success: false, error: error.message, }; } }
// Stripe webhook handler for subscription events import { NextApiRequest, NextApiResponse } from 'next'; import { buffer } from 'micro'; import Stripe from 'stripe'; import { updateUserSubscription } from '@/lib/db'; const stripe = new Stripe(process.env.STRIPE_SECRET_KEY as string, { apiVersion: '2022-11-15', }); export const config = { api: { bodyParser: false, }, }; export default async function handler( req: NextApiRequest, res: NextApiResponse ) { if (req.method !== 'POST') { return res.status(405).json({ error: 'Method not allowed' }); } const buf = await buffer(req); const sig = req.headers['stripe-signature'] as string; const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET as string; try { const event = stripe.webhooks.constructEvent( buf.toString(), sig, webhookSecret ); // Handle subscription events switch (event.type) { case 'customer.subscription.created': case 'customer.subscription.updated': const subscription = event.data.object as Stripe.Subscription; await updateUserSubscription(subscription); break; case 'customer.subscription.deleted': const cancelledSubscription = event.data.object as Stripe.Subscription; await updateUserSubscription(cancelledSubscription, true); break; default: console.log(`Unhandled event type: ${event.type}`); } res.status(200).json({ received: true }); } catch (err: any) { console.error(`Webhook error: ${err.message}`); res.status(400).json({ error: `Webhook error: ${err.message}` }); } }
Tap any block to copy to clipboard
Click any block to copy to clipboard • Press ⌘C to toggle chain mode
Sign Up Free • Pro users get unlimited blocks and files
Copy Companion helps developers in many different scenarios
Seamlessly copy documentation, code snippets, and prompts directly into AI assistants like ChatGPT and Claude Sonnet 3.7, preserving formatting and context for better code generation and AI response quality.
Store code with proper syntax highlighting across multiple languages, making it easier to read, search, and reuse your most important snippets.
Power users can navigate, search, and copy snippets without touching the mouse, creating a lightning-fast workflow for repetitive coding tasks.
Choose between light and dark themes to match your IDE setup, with Pro users enjoying additional theme options for a truly personalized experience.
Share collections with your team for standardized code snippets and documentation.
Access your code blocks from any device with our web-based interface.
Copy Companion helps developers in many different scenarios
Quickly chain together code snippets when working with AI assistants like ChatGPT and Claude Sonnet 3.7. Combine code blocks, configuration files, and specific error messages for more accurate AI-generated code and debugging suggestions.
Easily collect and organize code examples when writing documentation or creating tutorials. No more copying and pasting between multiple files and applications.
Build your own library of reusable code patterns, snippets, and solutions that you frequently need. Never solve the same problem twice.
Create a standardized library of code patterns and snippets that your team can reference. Ensure consistency across projects and team members.
Start free, upgrade when you need more power
Perfect for trying out Copy Companion
$0
Forever free
Everything you need for serious development
$4.99
per month
Need a custom plan for your team? Contact us for enterprise pricing
If Copy Companion saves developers even 30 minutes per month (at ~$75/hour), that's ~$37.50 in value. Most users report saving 1-2 hours weekly on code management and reuse.
No, you can store code blocks of any size with Copy Companion. The free plan is limited to 10 blocks total, while the Pro plan offers unlimited storage.
Yes, you can cancel your subscription at any time. Your Pro features will remain active until the end of your billing period with no hidden fees or commitments.
All data is encrypted at rest and in transit. We never share your code with third parties.
Join other developers who've discovered Copy Companion to streamline their coding workflow and boost productivity.
30 day money back guaranteed | Start instantly