• In the docs their is an example

    var MyPlugin = { myMethod: function(postData, callback) { var req = cls.get('http').req; // current http request object. var res = cls.get('http').res; // current http response object. var uid = req.user.uid; // current user id // ... }, ...

    but it never says how to determine what MyPlugin should be for your plugin? can you use anything? or is it declared somewhere im missing?

  • Plugin & Theme Dev

    It should symbolize what your plugins entry-point needs to export for NodeBB.

    So you could just add module.exports = MyPlugin at the end of the file named within plugin.json.
    I admin the docs could've been better explained in this regards. Feel free to change 😉

  • Ah that makes sense thanks

Suggested Topics

| | |

© 2014 – 2022 NodeBB, Inc. — Made in Canada.