Skip to main content

Installation

Adding Mailchain to your application is easy. Mailchain's SDK makes interacting with the Mailchain protocol simple. Using the SDK you will be able to send, receive (coming soon... for now you can view replies in https://app.mailchain.com) and register addresses (coming soon).

To add Mailchain's SDK to your application install via your package manager of choice.

npm install @mailchain/sdk

Browser support​

As Mailchain SDK is to be run primary by Node applications, it requires some polyfills to be used in the browser. Depending on your setup, you may need to polyfill Buffer, crypto and stream.

yarn add crypto-browserify stream-browserify
npm install crypto-browserify stream-browserify
// webpack.config.js
const webpack = require('webpack');

module.exports = {
// ...
resolve: {
fallback: {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
},
},
plugins: [
// ...
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
};