Mailgo is available also for Next.js and SSR
Mailgo can be easily added to any Next.js project just modifying
_app.js. You can check directly a repository of mailgo with Next.js (https://github.com/manzinello/next-mailgo) here the website deployed (thanks to Vercel): https://nextjs.mailgo.dev
and simply add
Here a complete example of a
_app.js with a configuration (dark mode):
Now mailgo is enabled in the entire web app!
Another running example (Next.js and also TypeScript) is my personal website: https://matteomanzinello.com
mailgo and then
then you have to call
mailgo(), IMPORTANT: do this when the object
window is defined.
Here an example with React hooks:
in this way you are sure that
window is defined and mailgo will work correctly.
Another way (no hooks) is this:
You can pass to the function
mailgo() also the configuration object.
BREAKING CHANGES from version 0.10.*: you can also use
but then you have to call
to start mailgo, here a complete example with Hooks:
Mailgo can be installed in Gatsby through an official plugin: https://www.gatsbyjs.com/plugins/gatsby-plugin-mailgo/