Camp Origin SDK

Pixel Game integrates seamlessly with Camp Network through the Origin SDK for wallet authentication and on-chain transactions.

Bootstrapping Providers

<QueryClientProvider client={queryClient}>
        <WagmiProvider config={wagmiConfig}>
          <CampProvider clientId="client_id">
            {children}
          </CampProvider>
        </WagmiProvider>
      </QueryClientProvider>
    </PrivyProvider>

Authenticating Users with Origin

Add the CampModal component anywhere in your app. It renders the authentication modal at the root and automatically injects a button where you place it.

import { CampModal } from "@campnetwork/origin/react";

export default function Auth() {
  return <CampModal />;
}

To access authentication state and wallet-connected utilities:

const { jwt, origin, viem } = useAuth();

More information in documentation at Campnetwork:

Last updated