Configuration
Services
Token
Token service is used to create and verify access tokens.
JWT
Uses JWT.
# ...
SERVICES_TOKEN_TYPE=JWT
SERVICES_TOKEN_SECRET=
SERVICES_TOKEN_TTL=
# ...
Geolocation
Geolocation is used when user logs in to find loacation from IP address. This can be then used to inform user about new login event with data about the device.
IPLOCATION
Uses IP Location.
# ...
SERVICES_GEOLOCATION_TYPE=IPLOCATION
# ...
IPSTACK
Uses IP Stack.
# ...
SERVICES_GEOLOCATION_TYPE=IPSTACK
SERVICES_GEOLOCATION_IPSTACK_ACCESS_KEY=
# ...
UNKNOWN
# ...
SERVICES_GEOLOCATION_TYPE=UNKNOWN
# ...
Callbacks
Each user action can be sent to multiple destinations to inform about the event. This can be used to send activation e-mail when new user registers or just to inform your backend about new registration.
Each callback is configured with json object containing an array of destinations:
[
{
"type": "HTTP",
"url": "https://destination/path"
}
]
onRegister
New user successfully registers (no duplicate email or other error).
Data:
{
name: 'user_register',
user: {
id: user.id,
email: user.email,
},
parameters: {
token: token,
...user.meta,
},
}
onLogin
User successfully logs in.
Data:
{
name: 'user_login',
user: {
id: user.id,
email: user.email,
},
parameters: {
os: useragent.os,
browser: useragent.browser,
version: useragent.version,
city: geolocation.city,
country: geolocation.country,
ip: ip,
...user.meta,
},
}