> 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: onGalleryCreated(event: GalleryCreated) # Method package: wixProGalleryBackend # Method menu location: wixProGalleryBackend --> onGalleryCreated # Method Link: https://dev.wix.com/docs/velo/events-service-plugins/pro-gallery/events/on-gallery-created.md # Method Description: An event that triggers when a gallery is created. The `onGalleryCreated()` event handler runs when a gallery has been created. The received `GalleryCreated` object contains information about the gallery that was created. >**Notes:** > + Backend events don't work when previewing your site. > + The event data doesn't include gallery items or their IDs. To get information about the items in your newly created gallery, listen for the [`onGalleryItemCreated()`](#ongalleryitemcreated) event. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## An event triggered when a gallery is created ```javascript // Place this code in the events.js file // of your site's Backend section. // Add the file if it doesn't exist. export function wixProGallery_onGalleryCreated(event) { const galleryId = event.entity._id; const galleryName = event.entity.name; const eventId = event.metadata.id; const eventTime = event.metadata.eventTime; } /* Full event object: * { * "entity": { * "_createdDate": "2022-08-04T10:00:09.000Z", * "_id": "b082d5aa-1e7b-44d9-91f3-ab0387825de5", * "items": [], * "name": "My New Gallery", * "totalItems": 2 * }, * "metadata": { * "entityId": "b082d5aa-1e7b-44d9-91f3-ab0387825de5", * "eventTime": "2022-08-04T10:00:09.559484Z", * "id": "1586937f-a154-4ad1-8ccf-488a63852e63", * "triggeredByAnonymizeRequest": false * } * } */ ``` ---