Module @troph-team/account

@troph-team/account

Usage

import {
AccountServiceFactory,
AccountRepositoryPostgres,
OAuthProvider,
} from '@troph-team/account'
import Koa from 'koa'
import bodyParser from 'koa-bodyparser'

const repository = new AccountRepositoryPostgres({
connectionString:
'postgresql://postgres:password@localhost:5432/account?schema=public',
})

const factory = new AccountServiceFactory(repository, {
auth: {
jwtSecret: 'secret',
},
oauth: {
providers: {
google: OAuthProvider.google({
clientId: '',
clientSecret: '',
}),
apple: OAuthProvider.apple({
teamId: '',
keyId: '',
clientId: '',
privateKey: '',
}),
},
},
email: {
smtp: {
host: '',
port: 0,
secure: false,
user: '',
pass: '',
},
sender: 'sender',
},
})

const app = new Koa()

app.use(bodyParser())
app.use(factory.getMiddleware())

app.listen(17000)

Index

Enumerations

Classes

Interfaces

Variables

Functions

Generated using TypeDoc