Go Headless

/

Velo
Articles
API Overview
Getting Started
Tutorials
Velo Package Readmes
Release Notes

Velo-Only APIs
About Velo-Only APIs and the SDK
$w
$widget
wix-animations-frontend
wix-configs-backend
wix-http-functions
wix-realtime-backend
wix-application
wix-editor
wix-widget

APIs
About Velo APIs and the SDK
wix-activity-counters.v2
wix-analytics.v2
wix-auth
wix-billing.v2
wix-billing-backend
wix-blog-backend
wix-bookings-frontend
wix-bookings.v1
wix-bookings.v2
wix-bookings-backend
wix-business-tools.v2
wix-cache-backend
wix-captcha.v2
wix-captcha-backend
wix-chat-backend
wix-comments.v2
wix-crm-frontend
wix-crm.v2
wix-crm-backend
wix-dashboard
wix-dashboard-management.v2
wix-data
wix-data.v2
wix-ecom.v2
wix-ecom-frontend
wix-ecom-backend
wix-email-marketing.v2
wix-events-frontend
wix-events.v2
wix-events-backend
wix-fetch
wix-forms.v2
wix-forum.v2
wix-forum-backend
wix-groups.v2
wix-groups-backend
wix-inbox.v2
wix-location-frontend
wix-loyalty.v2
wix-marketing-backend
wix-marketing.v2
wix-marketing-tags.v2
wix-media-backend
wix-media.v2
wix-members-frontend
wix-members.v2
wix-members-backend
wix-mobile
wix-multilingual.v2
wix-navigate-mobile
wix-pay-frontend
wix-pay-backend
wix-payment-provider-backend
wix-pricing-plans-frontend
wix-pricing-plans.v2
wix-pricing-plans-backend
wix-pro-gallery-backend
Introduction
Creating a Gallery
Tutorial: Display a Pro Gallery on Your Site
ProGallery
Introduction
createGallery()
createGalleryItem()
deleteGallery()
deleteGalleryItem()
getGallery()
getGalleryItem()
listGalleries()
listGalleryItems()
updateGallery()
updateGalleryItem()
wix-realtime-frontend
wix-reviews.v2
wix-restaurants.v2
wix-search
wix-secrets-backend
wix-secrets-backend.v2
wix-seo-frontend
wix-site-frontend
wix-site-backend
wix-storage-frontend
wix-storage-mobile
wix-stores.v2
wix-stores-frontend
wix-stores-backend
wix-table-reservations.v2
wix-tags.v1
wix-urls.v2
wix-web-module
wix-window-frontend
wix-site-plugins.v1

Events & Service Plugins
About Events & Service Plugins and the SDK
Activity Counters
Automations
Billing
Bookings
Business Tools
Comments
CRM
Data
eCommerce
Email Marketing
Forms
Forum
Groups
Inbox
Loyalty
Marketing
Marketing Tags
Media
Members
Pricing Plans
Payments
Pro-Gallery
Routers
Site Monitoring
Stores
Table Reservations
Wix Events





getGallery( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a gallery by ID.

Permissions
Manage Galleries
Read Galleries
Learn more about app permissions.
Method Declaration
Copy
function getGallery(
  galleryId: string,
  options: GetGalleryOptions,
): Promise<Gallery>;
Method Parameters
galleryIdstringRequired

Gallery ID.


optionsGetGalleryOptions

Options to use when getting the gallery.

Returns
Return Type:Promise<Gallery>
Get an existing gallery
JavaScript
import { proGallery } from "wix-pro-gallery-backend"; // Sample galleryId value: 'f18209c2-2ed5-4cbb-9cfd-45a3e6f93dbc' export async function myGetGalleryFunction(galleryId) { try { const gallery = await proGallery.getGallery(galleryId); const id = gallery._id; const name = gallery.name; const items = gallery.items; const firstItemTitle = gallery.items[0].title; console.log("Success! Got the gallery:", gallery); return gallery; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "_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": "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 New Gallery", * "sortOrder": "1098567432145", * "totalItems": 2 * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?