Welcome to Zuora Product Documentation

Explore our rich library of product information

Create ZQFClient instance

Learn how to create a ZQFClient instance from quoteState and optionally pageState so your component can read quote data and emit events to update the quote and its related objects.

Make sure that your component has access to quoteState. If your logic depends on the current interval, also make pageState available.

  1. Import ZQFClient from zqu/zqfClient.
  2. Call ZQFClient.from(source, options?) and pass a quoteState object or getter as the source.
  3. If your logic needs interval context, pass pageState in the options object.
  4. Store the returned client instance and use it in your hook code.
    import ZQFClient from 'zqu/zqfClient';
    
    const zqf = ZQFClient.from(() => this.quoteState, {
      pageState: () => this.pageState
    });
    

You can use the zqf instance to read values from quoteState and to create events for updating the quote, products, charges, tiers, amendments, and intervals.