lockGated Content

Use signIn to unlock access based on the wallet.

Use transferTokens to collect payment before unlocking access.

Gated Content Flow
import { RevibaseProvider, signIn, transferTokens } from "@revibase/lite";

const provider = new RevibaseProvider();

async function getWalletForGatedContent() {
  const { user } = await signIn(provider);
  return user.walletAddress;
}

async function getWalletForPaywallContent(
  orderTotal: bigint,
  merchantWallet: string
) {
  const { txSig, user } = await transferTokens(provider, {
    amount: orderTotal,
    destination: merchantWallet,
  });
  return { walletAddress: user.walletAddress, txSig };
}

Confirm txSig on-chain using your RPC before unlocking content.

Last updated