Configurations

Pace comes with a few configurations which can be used to configure your application. The configurations are stored in config/pace.ts and come with some reasonable defaults:

// config/pace.ts

import Env from '@ioc:Adonis/Core/Env'

export default {
  app: {
    name: Env.get('ENV_APP_NAME', 'Pace'),
    url: Env.get('APP_URL', 'http://127.0.0.1:3333'),
  },
  mail: {
    from: Env.get('MAIL_FROM_ADDRESS', 'support@pace.dev'),
    name: Env.get('MAIL_FROM_Name', 'Pace'),
  },
  auth: {
    emailVerification: {
      enabled: true,
      expiresIn: '24h',
    },
    passwordResetLinkExpiresIn: '1h',
    magicLink: {
      enabled: true,
      expiresIn: '24h',
    },
    twoFactorAuth: true,
    socialAuth: {
      enabled: true,
      providers: ['github', 'google', 'twitter'],
    },
  },
  billing: true,
  teams: true,
  apiKeys: true,
}

Let's quickly run through each of them.

  • app.name: This is the name of your application and it's read from the ENV_APP_NAME environment variable.
  • app.url: This is the URL of your application and it's read from the APP_URL environment variable.
  • mail.from: This is the default email address for transactional emails sent by your application.
  • mail.name: This is an optional name for the default email address from above.
  • auth.emailVerification: This is to control whether or not you want users to be sent an email verification upon signing on your application. You also can configure the expiry duration of the verification link.
  • auth.passwordResetLinkExpiresIn: This is the expiry duration for the password reset request link.
  • auth.magicLink: This is to control whether or not you want users to be able to sign in using magic link and the expiry duration for the magic link.
  • auth.twoFactorAuth: Enable or disable two-factor authentication.
  • auth.socialAuth: Enable or disable signing up or signing with OAuth providers. You can also specify a list of OAuth providers you want to support.
  • teams: Enable or disable teams functionality.
  • billing: Enable or disable billing functionality.
  • apiKeys: Enable or disable API tokens functionality.

You are free to tweak the configurations to suit your application.