Guide
Vue / Nuxt
Integrate Buff with Solana wallet adapter or Reown.
Install
$
npm install buff-protocol-sdk solana-wallets-vueCopyComposable
useBuff.ts
typescript
1import { ref, watch } from 'vue'2import { useWallet } from 'solana-wallets-vue'3import { Buff } from 'buff-protocol-sdk'45export function useBuff(apiKey: string) {6 const buff = ref<Buff | null>(null)7 const { signMessage, publicKey } = useWallet()89 watch([signMessage, publicKey], async ([sign, pk]) => {10 if (!sign || !pk) { buff.value = null; return }1112 const b = new Buff({13 apiKey,14 plan: 'sprout',15 investInto: 'BTC',16 })1718 // Authenticate with wallet signature19 const msg = new TextEncoder().encode('Sign in to Buff')20 const sig = await sign(msg)21 b.setWalletAuth(pk.toBase58(), Buffer.from(sig).toString('base64'))22 buff.value = b23 }, { immediate: true })2425 return { buff }26}Note
Both approaches use the same Buff SDK. Authentication is via API key or wallet signature headers — no signMessage callback needed.