Cordova plugin purchase not able to register product

plugin-purchase in my application but I’m getting

store.register is not function at cordova.js:232:49

Below are the code`

document.addEventListener('deviceready', function() {
// Initialize the store object
var store = window.store;

if (!store) {
    console.error('Store object not available.');
    return;
}

// Configure the store object
store.register({
    id: 'test_1', // Product ID
    alias: 'product1',              // Product alias (optional)
    type: store.NON_CONSUMABLE      // Product type (e.g., non-consumable)
});

// Add event listeners for purchase events
store.when('test_1').approved(function(purchase) {
    purchase.finish();
});

store.when('test_1').verified(function(purchase) {
    console.log('Purchase verified:', purchase);
});

// Refresh the store to get the latest product data
store.refresh();   }, false);

I have tired every answer but still not able to resolve this issue