Skip to main content

Installing the WhiskyPay SDK

This guide will walk you through installing and setting up the WhiskyPay SDK in your React application.

Prerequisites

Before you begin, make sure you have:
  • Node.js 16 or higher installed
  • npm or yarn package manager
  • A React application (Next.js, Create React App, Vite, etc.)

Installation

Install the WhiskyPay SDK using npm or yarn:

Dependencies

The SDK has peer dependencies that you might need to install if they’re not already in your project:

Basic Setup

Once installed, you can import the SDK in your React components:

Solana Wallet Adapter Setup

For the best experience, we recommend setting up the Solana wallet adapter in your application. This allows customers to connect their Solana wallets for payment. Here’s a basic setup for Next.js applications:

Environment Setup

If you plan to specify custom RPC URLs or API endpoints, you can set them up in your environment variables:
Then use them in your application:

Troubleshooting

If you encounter issues during installation:
  1. Version conflicts: Make sure your React version is compatible (React 18+ recommended)
  2. Webpack errors: Add the SDK to your transpilation process if using an older build system
  3. TypeScript errors: The SDK includes TypeScript definitions, but verify they’re properly recognized by your IDE

Next Steps

Now that you’ve installed the SDK, you can: