import { useState } from 'react';
import { CulqiProvider, useCheckout } from 'react-culqi-next';
<CulqiProvider publicKey="pk_test_4YrVwTo....your_public_key">
const [amount, setAmount] = useState(10000);
const [title, setTitle] = useState('White T-shirt');
const { openCulqi, token, error } = useCheckout({
console.log('Handle the closing of the modal');
console.log('Send your token to the backend', token);
console.log('handle the errors', error);
<button onClick={openCulqi}>Pay now</button>