Support for replaying with Nuxt is still a work-in-progress.


Install the useflytrap package to your Nuxt project.

npm install useflytrap

Add Flytrap code transform

Add the Flytrap code transform to your project by editing your Nuxt configuration, so that all your code gets properly processed for replaying.

Add the module to your Nuxt configuration:

// @ts-ignore
import { FlytrapTransformPlugin } from 'useflytrap/transform'

export default defineNuxtConfig({
	vite: {
		plugins: [process.env.NODE_ENV === 'production' && FlytrapTransformPlugin.vite()]

Create your Flytrap configuration

Next up, create your Flytrap configuration file. The configuration file defines what project you are capturing & replaying for, and the replay & capture behavior.

You can get the values for your Flytrap configuration file by creating a project as seen below.

Create project with credentials
import { defineFlytrapConfig } from 'useflytrap'

export default defineFlytrapConfig({
	projectId: 'your-project-id',
	captureId: 'capture id for replaying',
	publicApiKey: 'your public api key',
	secretApiKey: 'your secret api key',
	privateKey: 'your private key',
	mode: 'capture',
	// ignore Nuxt generated files
	excludeDirectories: ['.nuxt'],

Catch your first bug

Now your app will be enabled with Flytrap. You can test out the setup by throwing an error in your development environment.


Nuxt usage example

See how you can use Flytrap with Nuxt

Learn more

Explore how you can use Flytrap to ship more confidently, solve bugs faster and increase the productivity of your QA & developer teams.