Functions

Function: generateProductRssFeed

module product rss feed docid 6uo tqnspfsbpjdruymkw generateproductrssfeed ▸ generateproductrssfeed ( rawproducts , options? ) promise < string > generateproductrssfeed generates a rss feed for your products it can write the feed to a file if you specify a path it will also validate your products against the variable productrssfeeditemschema docid cru w1fpjdyjhe2xvokc for any validation issues z zoderror https //github com/colinhacks/zod/blob/78a409012a4dc34a455f5c4a7e028ca47c921e1b/error handling md if there are any validation issues you can find the issues by looking a the exceptions issues property to determine the exact issues this only happens if `options strict = true' minimal example with a single product that writes to the public directory in next js import { generateproductrssfeed } from '@chordcommerce/product rss feed/dist/simple' import path from 'node\ path' async function main() { const product = { id 'product 1', title 'product 1', description 'lorem ipsum', availability 'in stock', image link 'https //example com/product 1 jpg', price '10 usd', gtin '00000000', } await generateproductrssfeed(\[product], { title 'plant store', description 'the best plants in the world', url 'https //example com', strict true, path path join(process cwd(), 'public', 'products rss'), }) } main() parameters name type rawproducts type alias productfeediteminput docid\ yhuy zikybiklrgvb3hko \[] options? type alias productfeedoptions docid\ k1i guuk6zqyy 3nifedn returns promise < string > the rss feed as a string defined in packages/product rss feed/src/simple/index ts 344 https //github com/chordcommerce/chord ui/blob/2b105e1/packages/product rss feed/src/simple/index ts#l344