This project demonstrates the integration of Litlyx with a Nuxt 3 application. Follow the steps below to get started.
-
Sign Up on Litlyx Cloud
- Visit the Litlyx Dashboard and sign up for an account.
-
Create a New Project
- After signing in, create a new project in the Litlyx Dashboard.
-
Copy Your Project ID
- Once your project is created, copy the
project_idfrom the dashboard.
- Once your project is created, copy the
-
Initialize Litlyx in Your Nuxt Project
- Replace
PROJECT_IDin theLit.init("PROJECT_ID")function with your actualproject_id.
<script lang="ts" setup> import { Lit } from 'litlyx-js'; Lit.init("YOUR_PROJECT_ID"); function onButtonClick() { Lit.event('NuxtExampleButtonClick', { metadata: { title: 'Nuxt is awesome', subtitle: 'Litlyx too!' } }) } </script>
- Replace
-
Reload the Page
- Reload your Nuxt application to trigger your first visit event.
-
(Optional) Test a Custom Event
- Click the "Test your event" button to trigger a custom event defined in the
onButtonClickfunction.
- Click the "Test your event" button to trigger a custom event defined in the
- After setting up and initializing your project with Litlyx, reload your application.
- Click the "Test your event" button to ensure the custom event is triggered correctly.
Enjoy using Litlyx with your Nuxt 3 project!