> ## Documentation Index
> Fetch the complete documentation index at: https://crossmint-wallets-docs-2-5.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart ⚡

> Add a digital asset checkout button to a demo app in under 5 minutes

<Frame type="simple">
  <img src="https://mintcdn.com/crossmint-wallets-docs-2-5/l5RZBZ_vez8njfCH/images/payments/pay-button/quickstart/example.jpg?fit=max&auto=format&n=l5RZBZ_vez8njfCH&q=85&s=c9e7cf2103a1fd8a876f323b430991a3" alt="Crossmint Hosted Digital Asset Checkout Demo" width="3434" height="1508" data-path="images/payments/pay-button/quickstart/example.jpg" />
</Frame>

## Introduction

In this guide, you will build a demo site with nextjs and Crossmint's payment button. You can follow step-by-step below or simply [clone this repo](https://github.com/Crossmint/pay-button-demo) to be up and running immediately.

<Snippet file="payments-prereqs.mdx" />

<Snippet file="payments-setup.mdx" />

### Integrate the Payment Button

<Steps>
  <Step title="Obtain your `projectId` and `collectionId` from your collection detail view in the console">
    <Frame type="simple">
      <img src="https://mintcdn.com/crossmint-wallets-docs-2-5/l5RZBZ_vez8njfCH/images/payments/shared/project-id-collection-id.jpg?fit=max&auto=format&n=l5RZBZ_vez8njfCH&q=85&s=8dd1af5a80336ae305ca3b177422dfe6" alt="Get projectId and collectionId values screenshot" width="2200" height="842" data-path="images/payments/shared/project-id-collection-id.jpg" />
    </Frame>
  </Step>

  <Step title="Add a new file named `.env.local` to root directory of your project">
    Configure your environment variables with the values from Step 1.

    <Check>These values are not sensitive and can be used client-side.</Check>

    ```git .env.local theme={null}
    NEXT_PUBLIC_PROJECT_ID="_YOUR_PROJECT_ID_"
    NEXT_PUBLIC_COLLECTION_ID="_YOUR_COLLECTION_ID_"
    NEXT_PUBLIC_ENVIRONMENT="staging"
    ```
  </Step>

  <Step title="Open the `/src/app/page.tsx` file in your editor">
    Replace the entire contents with the following:

    <CodeGroup>
      ```tsx EVM theme={null}
      "use client";

      import { CrossmintPayButton } from "@crossmint/client-sdk-react-ui";

      export default function Home() {
        const projectId = process.env.NEXT_PUBLIC_PROJECT_ID as string;
        const collectionId = process.env.NEXT_PUBLIC_COLLECTION_ID as string;
        const environment = process.env.NEXT_PUBLIC_ENVIRONMENT as string;

        return (
          <div>
            <CrossmintPayButton
              projectId={projectId}
              collectionId={collectionId}
              environment={environment}
              mintConfig={{
                type: "erc-721",
                totalPrice: "0.0001",
              }}
            />
          </div>
        )
      }
      ```

      ```tsx Solana theme={null}
        /*
          For candy machine integrations, the mintConfig object is optional.
          Only include it if your candy machine uses minting groups:

          mintConfig={{
            mintingGroup: "YOUR_MINTING_GROUP_NAME"
          }}
        */

        <CrossmintPayButton
          projectId={projectId}
          collectionId={collectionId}
          environment={environment}
        />
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the application from your terminal">
    ```bash theme={null}
    pnpm dev
    ```
  </Step>
</Steps>

**That's it!** 🎉

Open the app in your browser with the url `http://localhost:3000/`. The Hosted Checkout Button will appear in the top left of the browser. You can click it to open the checkout popup and ensure everything is configured properly.

## Next Steps

Now you have a working demo of the Hosted Checkout. If you're ready to dig into the details of the configuration options and advanced features, check out the following sections:

<CardGroup cols={3}>
  <Card title="SDK Reference" icon="gear" iconType="duotone" color="9E9E9E" href="/payments/advanced/component-properties" />

  <Card title="Launch in Production" icon="ship" iconType="duotone" color="3AA9D8" href="/payments/advanced/production-launch" />

  <Card title="Customize the Button" icon="brush" iconType="duotone" color="E78428" href="/payments/pay-button/ui-customization" />

  <Card title="Localization" icon="globe" iconType="duotone" color="1983EF" href="/payments/advanced/localization" />

  <Card title="Multi-purchases" icon="cart-plus" iconType="duotone" color="FF7C9F" href="/payments/advanced/selling-multiple-nfts" />

  <Card title="USDC support" icon="dollar-sign" iconType="duotone" color="116A32" href="/payments/advanced/usdc-support" />
</CardGroup>
