Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@mixcore/user

Authentication and user management services for Mixcore SDK. Provides login, session handling and user profile management.

Features

  • Email/password authentication
  • Social login (Google, Facebook, etc.)
  • Session management
  • User profile CRUD operations
  • Permission checking
  • Framework-agnostic implementation

Installation

npm install @mixcore/user
# or
pnpm add @mixcore/user

Usage

Basic Authentication

import { 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();

User Management

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' });

API Reference

AuthServices

Method Description
login(email, password) Authenticates user
logout() Ends session
checkSession() Verifies active session
register(userData) Creates new account

UserServices

Method Description
getProfile() Gets user profile
updateProfile(data) Updates profile
hasPermission(perm) Checks permission

Related Packages

Framework Integration

This package works with all JavaScript frameworks. See the main README for framework-specific integration examples.

Package-specific Usage

// 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);
  }
}

Related Packages

License

Mixcore Community License (MCL). See LICENSE for details.