Installing
Install theuseflytrap package to your project.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use Flytrap to catch & replay both front-end & back-end bugs with a Webpack bundled program
useflytrap package to your project.
npm install useflytrap
yarn add useflytrap
pnpm install useflytrap
// @ts-check
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const { FlytrapTransformPlugin } = require('useflytrap/transform');
/** @type { import('webpack').Configuration } */
module.exports = {
target: 'node',
mode: 'production',
externals: [nodeExternals()],
entry: {
app: './src/index.ts'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].cjs'
},
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts$/,
use: [
'ts-loader',
],
},
],
},
plugins: [
// only add in production
...(process.env.NODE_ENV === 'production' ? [FlytrapTransformPlugin.webpack()] : []),
]
};
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'
})
