Hi @Sliman_Medini!
Not sure what I could provide, at the documentation example it’s:
integrations: {
mixpanel: {
apiKey: process.env.MIXPANEL_API_KEY,
apiSecret: process.env.MIXPANEL_SECRET_KEY,
mapping: ['customers.email'],
customProperties: ['Campaign Source', 'plan', 'tutorial complete'],
mixpanel: require('mixpanel-data-export')
},
},
I’m pretty much tying to mimic it, but I don’t understand exactly what mapping would suggest:
In our example we will map the customers.email
with the data coming from Mixpanel.
I have email on Mixpanel data, and on user Model, so I tried to map with this data.
Also, I have followed each step explained here Load smart fields using hook - Woodshop for old agent generation , my entire middlewares/forestadmin.js is:
const chalk = require('chalk');
const path = require('path');
const Liana = require('forest-express-mongoose');
const mongoose = require('mongoose');
module.exports = async function (app) {
app.use(await Liana.init({
modelsDir: path.join(__dirname, '../models'),
configDir: path.join(__dirname, '../forest'),
envSecret: process.env.FOREST_ENV_SECRET,
authSecret: process.env.FOREST_AUTH_SECRET,
mongoose,
integrations: {
mixpanel: {
apiKey: process.env.MIXPANEL_API_KEY,
apiSecret: process.env.MIXPANEL_SECRET_KEY,
mapping: ['User.email'],
mixpanel: require('mixpanel-data-export')
},
},
}));
console.log(chalk.cyan('Your admin panel is available here: https://app.forestadmin.com/projects'));
};
package.json:
"forest-express-mongoose": "^6.5.1",
"forest-express-sequelize": "^6.5.0",
"mixpanel-data-export": "^2.0.2",
Also on the explanation is:
Then, add the following code to your app.js
file
But when you see the code shows
middlewares/forestadmin.js
Thanks!