Authentication and user management services for Mixcore SDK. Provides login, session handling and user profile management.
- Email/password authentication
- Social login (Google, Facebook, etc.)
- Session management
- User profile CRUD operations
- Permission checking
- Framework-agnostic implementation
npm install @mixcore/user
# or
pnpm add @mixcore/userimport { AuthServices } from '@mixcore/user';
const authService = new AuthServices();
// Login
const user = await authService.login('user@example.com', 'password');
// Check session
const isLoggedIn = await authService.checkSession();
// Logout
await authService.logout();import { UserServices } from '@mixcore/user';
const userService = new UserServices();
// Get current user
const profile = await userService.getProfile();
// Update profile
await userService.updateProfile({ name: 'New Name' });| Method | Description |
|---|---|
login(email, password) |
Authenticates user |
logout() |
Ends session |
checkSession() |
Verifies active session |
register(userData) |
Creates new account |
| Method | Description |
|---|---|
getProfile() |
Gets user profile |
updateProfile(data) |
Updates profile |
hasPermission(perm) |
Checks permission |
This package works with all JavaScript frameworks. See the main README for framework-specific integration examples.
// Example: Using with Angular
import { Injectable } from '@angular/core';
import { AuthServices } from '@mixcore/user';
@Injectable({ providedIn: 'root' })
export class AuthService {
private auth = new AuthServices({
apiBaseUrl: environment.apiUrl,
apiKey: environment.apiKey
});
login(email: string, password: string) {
return this.auth.login(email, password);
}
}- @mixcore/api: API client foundation
- @mixcore/navigation: Route guards using auth
Mixcore Community License (MCL). See LICENSE for details.