This sample Nuxt3 app demonstrates the integration of LaunchDarkly Vue and NodeJS SDKs. It showcases how to use feature flags to control the behavior and appearance of your application.
The app is built using the Nuxt3 starter script. For more information, refer to the Nuxt 3 documentation.
- Integration with LaunchDarkly Vue and NodeJS SDKs
- Usage of feature flags to control frontend and backend functionality
- Easy setup and configuration using environment variables
Before running the application, ensure you have the following:
- LaunchDarkly Account
- LaunchDarkly SDK key and Client Side ID
- NodeJS >= 16.x
- Nuxt3
Follow these steps to set up and run the application:
-
Clone the repository:
git clone https://github.com/your-username/launchdarkly-nuxt3-sample.git cd launchdarkly-nuxt3-sample
-
Install the dependencies:
# Using yarn yarn install # Using npm npm install
-
Create a
.env
file in the root directory of the project and add the following environment variables:CLIENT_SIDE_ID=<LaunchDarkly client side ID> SERVER_SIDE_SDK_KEY=<LaunchDarkly SDK key>
Replace
<LaunchDarkly client side ID>
and<LaunchDarkly SDK key>
with your actual LaunchDarkly client-side ID and SDK key. -
Create the following feature flags in your LaunchDarkly project:
frontend-toggle
backend-toggle
-
Start the development server:
npm run dev
The application will be accessible at
http://localhost:3000
.
To build the application for production, run the following command:
npm run build
To preview the production build locally, use:
npm run preview
For more information on deploying your Nuxt3 application, refer to the deployment documentation.