Skip to content

Commit c1cf88c

Browse files
committed
remove emails and hooks from README
1 parent b065aea commit c1cf88c

File tree

1 file changed

+2
-47
lines changed

1 file changed

+2
-47
lines changed

README.md

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -44,54 +44,9 @@ npm i -S @accounts/redis
4444
npm i -S @accounts/sql
4545
```
4646

47-
## Example
47+
## Examples
4848

49-
You can find a working example [here](https://github.com/accounts-js/examples).
50-
51-
## Emails
52-
53-
Configuration:
54-
```javascript
55-
AccountsServer.config({
56-
siteUrl: 'https://my-app.com',
57-
email: // a valid email config object passed to emailjs
58-
// https://github.com/eleith/emailjs#example-usage---text-only-emails
59-
// You can handle the send of the emails by providing an optional sendMail function
60-
// sendMail: ({ from, to, text, html }): Promise<void>
61-
});
62-
```
63-
64-
To overwrite the email templates:
65-
```javascript
66-
AccountsServer.emailTemplates.from = 'my-app <[email protected]>';
67-
AccountsServer.emailTemplates.verifyEmail.subject = (user) => `Verify your account email ${user.profile.lastname}`;
68-
AccountsServer.emailTemplates.verifyEmail.text = (user, url) => `To verify your account email please click on this link: ${url}`;
69-
```
70-
71-
## Server Side Hooks
72-
73-
`@accounts/server` also exposes hooks, that let you know about actions that happened by the client. every action has a hook for success and error.
74-
75-
> Server side hooks does not effect the flow on the actions at all - it's just a notification.
76-
77-
> You can subscribe to each hook multiple time!
78-
79-
Pass for each hooks a callback function, and each hooks provides a different arguments.
80-
81-
The following hooks are available:
82-
83-
* `onLoginSuccess`: will call with the login result, an object with: `({ sessionId, user, tokens: { accessToken, refreshToken } })`
84-
* `onLoginError`: the callback will call with the `AccountsError` object.
85-
* `onLogoutSuccess`: will be caled with the logout result: `(user, session, accessToken)`
86-
* `onLogoutError`: the callback will call with the `AccountsError` object.
87-
* `onCreateUserSuccess`: will call with: `(userId, userObject)`
88-
* `onCreateUserError`: the callback will call with the `AccountsError` object.
89-
* `onResumeSessionSuccess`: will call with `(user, accessToken)`
90-
* `onResumeSessionError`: the callback will call with the `AccountsError` object.
91-
* `onRefreshTokensSuccess`: will call with: `({ sessionId, user, tokens: { accessToken, refreshToken } })`
92-
* `onRefreshTokensError`: the callback will call with the `AccountsError` object.
93-
* `onImpersonationSuccess`: will call with: `(originalUser, impersonationResult: { authorized, user, tokens: { refreshToken, accessToken }})`
94-
* `onImpersonationError`: the callback will call with the `AccountsError` object.
49+
You can find a working examples [here](https://github.com/accounts-js/examples).
9550

9651
## Contributors
9752

0 commit comments

Comments
 (0)