> 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: onContactCreated(event: ContactCreatedEvent) # Method package: wixCrmBackend # Method menu location: wixCrmBackend --> Events --> onContactCreated # Method Link: https://dev.wix.com/docs/velo/apis/wix-crm-backend/events/on-contact-created.md # Method Description: An event that triggers when a new contact is created. The `onContactCreated()` event handler runs when a new [contact](https://support.wix.com/en/article/about-your-contact-list) is created. The received `ContactCreatedEvent` object contains information about the contact that was created. > **Note:** Backend events don't work when previewing your site. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## An event fired when a contact 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 wixCrm_onContactCreated(event) { const contactId = event.metadata.entityId; const contactName = `${event.entity.info?.name?.first} ${event.entity.info?.name?.last}`; console.log('Contact created', event); } /* Full event object: * { * "metadata": { * "id": "fde04f82-c5e4-442e-b70e-0fd3f506f2e8", * "entityId": "bea905ef-d7cb-49b9-bce7-19342d3e7ab3", * "eventTime": "2021-02-12T00:18:03.097922Z", * "triggeredByAnonymizeRequest": false * }, * "entity": { * "_id": "bea905ef-d7cb-49b9-bce7-19342d3e7ab3", * "_createdDate": "2021-02-12T00:18:03.045Z", * "_updatedDate": "2021-02-12T00:18:03.046Z", * "revision": 0, * "info": { * "name": { * "first": "Ari", * "last": "Thereyet" * }, * "extendedFields": { * "contacts.displayByFirstName": "Ari Thereyet", * "contacts.displayByLastName": "Thereyet Ari" * } * }, * "source": { * "wixAppId": "v4.createContact" * }, * "lastActivity": { * "activityDate": "2021-02-12T00:18:03.045Z", * "activityType": "CONTACT_CREATED" * } * } * } */ ``` ---