Skip to content
Get started with Solana Pay by installing the JavaScript SDK and setting up your development environment. The SDK is framework-agnostic and works with any JavaScript environment.

​System Requirements

  • Node.js: Version 20.18 or higher, the floor @solana/kit declares (Node.js 20 or later also provides the Ed25519 crypto.subtle support)
  • Package manager: npm, which ships with Node.js
  • TypeScript: Version 5+ (recommended but not required)

​Install Solana Pay SDK

​Peer Dependencies

@solana/pay declares all of these packages as required peer dependencies. npm 7 and later installs them with @solana/pay:
PackageVersion
@solana/kit^6.5.0
@solana/keys^6.5.0
@solana/rpc-subscriptions-api^6.5.0
@solana/rpc-subscriptions-spec^6.5.0
@solana-program/system^0.12
@solana-program/token^0.12
@solana-program/token-2022^0.9
@solana-program/memo^0.11
@solana/kit-plugin-rpc^0.8
@solana/kit-plugin-payer^0.8
@solana/kit-plugin-instruction-plan^0.8

​Packages Your Code Imports

Add the peers your own code imports to your package.json, so their versions stay pinned. For transfer creation and validation (SOL and SPL token transfers):
For the client factories (createMerchantClient, createWalletClient), also install the kit plugins:

​Use ES Modules

Many examples in these guides use top-level await, which only works in an ES module. In a default npm init project ("type": "commonjs"), npx tsx file.ts fails with Top-level await is currently not supported with the "cjs" output format. Set the package type to module, or name your files with the .mts extension:

​TypeScript Configuration

If using TypeScript, ensure your tsconfig.json includes:

​Environment Setup

​Development Environment

Set up environment variables for development:

​Production Environment

For production, use mainnet endpoints:

​Verify Installation

Create a simple test to verify everything is working:
Run the test:
You should see a valid Solana Pay URL in the console.

​Common Issues and Solutions

​Module Resolution Errors

If you see errors like “Cannot resolve module ‘@solana/pay’”:
  1. Clear the npm cache:
  2. Delete node_modules and reinstall:

​TypeScript Errors

If you encounter TypeScript errors:
  1. Update to the latest TypeScript version (5+)
  2. Ensure moduleResolution is set to "bundler" or "nodenext" in your tsconfig.json

​Next Steps

Now that you have Solana Pay installed, choose your integration path:

​Development Tools

Consider installing these helpful development tools:

​Resources