const requestIp = require('request-ip'); module.exports = strapi => { return { initialize() { strapi.app.use(async (ctx, next) => { const clientIp = requestIp.getClientIp(req); ctx.client_id = clientIp; next(); }); }, }; };