Skip to content

Conversation

homanp
Copy link
Collaborator

@homanp homanp commented Jul 18, 2025

This pull request integrates the Coinbase OnchainKit Fund Button into our Next.js application. Here's a summary of the changes:

  1. Added @coinbase/onchainkit and wagmi dependencies to package.json.
  2. Updated app/layout.tsx to include OnchainKit styles and wrap the application with the Providers component.
  3. Modified app/page.tsx to add the FundButton component to the home page.

To complete the integration, please follow these additional steps:

  1. Create a providers.tsx file in the app directory with the following content:
'use client';
import { OnchainKitProvider } from '@coinbase/onchainkit';
import { base } from 'wagmi/chains';

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <OnchainKitProvider
      apiKey={process.env.NEXT_PUBLIC_ONCHAINKIT_API_KEY!}
      projectId={process.env.NEXT_PUBLIC_CDP_PROJECT_ID!}
      chain={base}
    >
      {children}
    </OnchainKitProvider>
  );
}
  1. Set up the required environment variables by creating a .env file in the project root with the following content:
NEXT_PUBLIC_ONCHAINKIT_API_KEY=YOUR_CLIENT_API_KEY
NEXT_PUBLIC_CDP_PROJECT_ID=YOUR_CDP_PROJECT_ID

Replace YOUR_CLIENT_API_KEY and YOUR_CDP_PROJECT_ID with your actual Coinbase API key and CDP project ID.

  1. Ensure that "enforce secure initialization" is disabled in your Coinbase Developer dashboard to avoid potential "something went wrong" errors when loading the Coinbase flow.

These changes will integrate the Coinbase OnchainKit Fund Button into the application, allowing users to easily fund their accounts directly from the home page.

- Add @coinbase/onchainkit and wagmi dependencies
- Update app/layout.tsx to include OnchainKit styles and Providers
- Add FundButton to app/page.tsx
@homanp homanp added the claude Generated by Claude AI agent label Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
claude Generated by Claude AI agent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant