CleverAuth Core
import {
Core,
KnexAdapter,
MongoAdapter,
DefaultEmailService,
DefaultMediaService,
Crypto,
JWT,
Validations,
TwilioSMSService
} from '@clevertech/auth-core'
const db = new MongoAdapter('<uri>')
const db = new KnexAdapter({
})
const sms = new TwilioSMSService({
accountSid: '',
authToken: '',
numberFrom: ''
})
const core = new Core({
projectName: '<projectName>',
db,
email: new DefaultEmailService({
projectName: '',
confirmEmailURL: '',
requestResetPasswordURL: '',
resetPasswordURL: '',
emailServiceConfig: {
}
}),
media: new DefaultMediaService(
{
}
),
crypto: new Crypto('<key>', '<algorithm> = aes-256-gcm'),
jwt: new JWT(
'<algorithm>',
'<secretOrPrivateKey>',
'<secretOrPublicKey>',
{
}
),
validations: new Validations(['name', 'company'], true),
sms,
numberOfRecoverCodes: 10
})