> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: listGalleries(options: ListGalleriesOptions) # Method package: wixProGalleryBackend # Method menu location: wixProGalleryBackend --> proGallery --> listGalleries # Method Link: https://dev.wix.com/docs/velo/apis/wix-pro-gallery-backend/pro-gallery/list-galleries.md # Method Description: Retrieves a list of galleries. This function retrieves a list of up to 10 galleries at a given time. To list the next 10 galleries in your site's backend, use the `offset` parameter. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## List Galleries ```javascript import { proGallery } from 'wix-pro-gallery-backend'; export async function myListGalleriesFunction() { try { const galleries = await proGallery.listGalleries(); const firstGalleryId = galleries[0]._id; const secondGalleryName = galleries[1].name; console.log('Success! Got a list of galleries:', galleries); return galleries; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "galleries": [ * { * "_createdDate": "Mon Feb 08 2021 13:44:37", * "_id":"10874ccf-5867-4225-9550-3885079bad66", * "items": [ * { * "_createdDate": Tue Mar 30 2021 15:23:22, * "_id": "534264c7-0c61-45ce-b414-891aacadf4c2", * "_updatedDate": Tue Mar 30 2021 15:23:22, * "description": "This is the first item in my gallery.", * "sortOrder": 1657439075188, * "tags": { * "values": ["pickles","salad","burger"] * }, * "title": "Item 1", * "type": "VIDEO", * "video": { * "type": 'VIMEO', * "videoInfo": 'https://vimeo.com/322240916', * "duration": 5000 * } * }, * { * "_createdDate": Sun Jul 03 2022 12:05:15, * "_id": "4507a07b-ab93-4326-a222-6d0bd8da0625", * "_updatedDate": Tues Jul 05 2022 10:25:45, * "description": "This is the second item in my gallery.", * "sortOrder": 1857439076299, * "title": "Item 2", * "type": "IMAGE", * "image": { * "imageInfo": "wix:image://v1/25139f9568b74d8aac6286c9ac1e8186.jpg/25139f9568b74d8aac6286c9ac1e8186.jpg#originWidth=4000&originHeight=2667" * } * } * ], * "name": "My First Gallery", * "sortOrder": "1098567432145", * "totalItems": 2 * }, * { * "_createdDate": "Mon Feb 08 2021 13:44:37", * "_id":"10874ccf-5867-4225-9550-3885079bad66", * "items": [ * { * "_createdDate": Tues Jul 05 2022 08:02:37, * "_id": "2297a07b-ab93-4326-a222-6d0bd8da0625", * "_updatedDate": Tues Jul 05 2022 10:25:45, * "description": "This is the second item in my gallery.", * "sortOrder": 1857439076299, * "title": "My only item", * "type": "VIDEO", * "video": { * "type": 'YOUTUBE', * "videoInfo": 'https://www.youtube.com/results?search_query=uplifting+upbeat+music', * "duration": 2000 * } * } * ], * "name": "My Second Gallery", * "sortOrder": "5568837432149", * "totalItems": 1 * } * ], * "totalGalleries": 2 * } */ ``` ## List galleries with additional options ```javascript import { proGallery } from 'wix-pro-gallery-backend'; /* Sample itemLimit value: 1 * Sample limit value: 1 * Sample offset value: 1 */ export async function myListGalleriesFunction(itemLimit, limit, offset) { try { const galleries = await proGallery.listGalleries({itemLimit, limit, offset}); const secondGalleryId = galleries[0]._id; const secondGalleryName = galleries[0].name; console.log('Success! Got a list of galleries:', galleries); return galleries; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "galleries": [ * { * "_createdDate": "Mon Feb 08 2021 13:44:37", * "_id":"10874ccf-5867-4225-9550-3885079bad66", * "items": [ * { * "_createdDate": Tue Mar 30 2021 15:23:22, * "_id": "534264c7-0c61-45ce-b414-891aacadf4c2", * "_updatedDate": Tue Mar 30 2021 15:23:22, * "description": "This is the first item in my gallery.", * "sortOrder": 1657439075188, * "title": "Item 1", * "type": "IMAGE", * "image": { * "imageInfo": "wix:image://v1/38939f9568z222d6avc6285c9ac1e9129.jpg/38939f9568z222d6avc6285c9ac1e9129.jpg#originWidth=200&originHeight=199" * } * } * ], * "name": "My Second Gallery", * "sortOrder": "1098567432145", * "totalItems": 1 * } * ] * "totalGalleries": 2, */ ``` ---