Sandbox Server

The ICPay sandbox server provides a testing environment where new features are introduced first, allowing developers to test integrations before they're available in production.

Overview

The sandbox server is available at:

Important Notes

  • Sandbox Environment: This is a testing environment and may be unavailable at times due to feature rollouts, updates, or maintenance.
  • New Features First: New features and updates are typically deployed to the sandbox before production, making it ideal for early testing and integration.
  • Test Networks: The sandbox includes mainnets but also testnet and devnet networks (Base Sepolia and Solana Devnet) so you can test with free faucet tokens without spending real funds.

Test Networks

The sandbox server supports the following test networks for development and testing:

Chain NameChain IDRPC URLFaucet Link
Base Sepolia84532https://sepolia.base.orgChainlink Faucet / ETHGlobal Faucet
Solana Devnet-https://api.devnet.solana.comSolana Faucet / QuickNode Faucet

Getting Test Tokens

Both networks provide free test tokens through their respective faucets:

  • Base Sepolia: Request test ETH from the Chainlink or ETHGlobal faucets to pay for gas fees and test transactions.
  • Solana Devnet: Request test SOL from the Solana faucet to pay for transaction fees and test Solana-based payments.

These test tokens have no real-world value and are intended solely for development and testing purposes.

Using with Widget

To use the ICPay Widget with the sandbox server, configure the apiUrl option in your widget config to point to the sandbox API endpoint.

Widget examples with sandbox

'use client'
import { useEffect, useRef } from 'react'
import '@ic-pay/icpay-widget'

export default function Page() {
  const ref = useRef<any>(null)
  useEffect(() => {
    if (!ref.current) return
    ref.current.config = {
      publishableKey: process.env.NEXT_PUBLIC_ICPAY_PK,
      apiUrl: 'https://api.betterstripe.com', // Sandbox API endpoint
      amountsUsd: [1, 5, 10],
      defaultAmountUsd: 5,
    }
    const onDone = (e: any) => console.log('Tip completed', e.detail)
    window.addEventListener('icpay-sdk-transaction-completed', onDone)
    return () => window.removeEventListener('icpay-sdk-transaction-completed', onDone)
  }, [])
  return <icpay-tip-jar ref={ref as any} />
}

Note: Make sure you're using a publishable key from your sandbox account at betterstripe.com. The sandbox uses test networks (Base Sepolia and Solana Devnet), so you'll need test tokens from the faucets listed above to complete transactions.

Was this page helpful?