Deployment ========== Custom ------ In production you should provide certain properties: * :any:`Config.graphiql`: desactivate the development IDE by setting this property to ``false``. * :any:`Config.nodemailerConfig`: provide a nodemailer configuration to send real emails to your users. * :any:`Config.mailFrom`: Define the sender address displayed in emails sent to users. * :any:`Config.host`: Public URL of the service. It will be used in emails sent to users to define for instance valid confirmation link. * :any:`Config.dbAddress`: Define the connection to a MongoDB database. * :any:`Config.privateKeyFilePath`: Provide the file path to the Private Key that will be used. * :any:`Config.publicKeyFilePath`: Provide the file path to the Public Key that will be used. .. note:: You can use a pair of Private and Public keys previously generated by Krypton Authentication. If you are running multiple instances behind a load balancer be sure to provide the same pair of keys to each instance. Example: .. code-block:: js const kryptonAuth = require('@krypton-org/krypton-auth'); const express = require('express'); const EventEmitter = require('events'); const nodemailer = require('nodemailer'); const app = express(); const eventEmitter = new EventEmitter(); eventEmitter.on('email-error', (email) => { //Log email to be able to resend it again. }); eventEmitter.on('error', (err) => { //Log error }); const options = { graphiql: false, host: "https://my-service-public-adress.com", mailFrom: '"Foo Bar" ', nodemailerConfig: { host: "smtp.example.email", port: 465, secure: true, auth: { user: "FooBar", pass: "F@@8aR" } }, dbAddress: "mongodb://login:password@something.mlab.com:19150/dbName", eventEmitter, privateKeyFilePath: './private-key.txt', publicKeyFilePath: './public-key.txt' }; app.use('/auth', kryptonAuth(options)); app.listen(process.env.PORT || 80); Heroku ------ .. image:: https://www.herokucdn.com/deploy/button.svg :target: https://heroku.com/deploy?template=https://github.com/krypton-org/krypton-heroku Docker ------ See `krypton-org/krypton-docker `_.