Skip to content

Kora Quick Reference

🚧 Development Documentation - Use with Caution

This reference covers experimental Kora integration features. Do not use in production applications without thorough testing.

Kora is a Solana relayer that enables gasless transactions where users pay fees in SPL tokens instead of SOL.

Key Impact: Users never need SOL - they can transact entirely using USDC, BONK, or any supported token.

How It Works

  1. User creates transaction with your app instruction
  2. Kora adds fee payment instruction in the selected SPL token
  3. User signs the complete transaction
  4. Kora signs as fee payer and submits to Solana
  5. Result: SPL tokens go to Kora operator, SOL fees paid by Kora

Installation

npm install @kora/sdk

Basic Methods

Setup Client

import { KoraClient } from '@kora/sdk';
 
const kora = new KoraClient({
  rpcUrl: process.env.REACT_APP_KORA_RPC_URL,
});

Get Payer Address

const { signer_address } = await kora.getPayerSigner();

Sign Transaction

const signedTx = await kora.signTransaction({
  transaction: transaction.serialize(),
});

Sign and Send

const signature = await kora.signAndSendTransaction({
  transaction: transaction.serialize(),
});

Basic Hook

export function useKora() {
  const [kora] = useState(() => new KoraClient({
    rpcUrl: process.env.REACT_APP_KORA_RPC_URL!
  }));
 
  return {
    getPayerAddress: () => kora.getPayerSigner(),
    signTransaction: (tx) => kora.signTransaction({ transaction: tx.serialize() }),
    signAndSend: (tx) => kora.signAndSendTransaction({ transaction: tx.serialize() }),
  };
}

Environment Setup

REACT_APP_KORA_RPC_URL=your-kora-server-url
REACT_APP_KORA_API_KEY=your-api-key

Official Resources

Complete Integration

For full LazorKit + Kora integration, see the complete guides in this documentation.