Closed xXTim97Xx closed 1 year ago
Hi, @xXTim97Xx can you share a bit more context on the environment you're using? Node version, library version etc.
Node Version: 15.8.0 React: 17.0.1 node-mailjet: 6.0.3
You can also check my IntelliSense that it really is not shown here
So you're trying to use require
in the client's code? You can't do this as it's part of the node CommonJS module system.
Can you use import instead? As described here: https://github.com/mailjet/mailjet-apiv3-nodejs#send-email-example
Yes, thanks a lot. This seems to work that way. But how do I use the proxy hack for testing?
I'm always receiving a CORS Error now
@xXTim97Xx it's because you need to set up your headers correctly to allow these cross-origin requests. You can read about them here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
const Mailjet = require('node-mailjet');
const mailjet = Mailjet.apiConnect(process.env.MJ_APIKEY_PUBLIC, process.env.MJ_APIKEY_PRIVATE);
I always receive errors like "Mailjet.apiConnect is not a function" or "Mailjet.connect is not a function"