A comprehensive authentication SDK for Python with Pydantic support. Features include user registration, login, 2FA, password management, and secure token handling.
Project description
Arvasit Authentication SDK
A comprehensive authentication SDK for Node.js and Python with TypeScript/Pydantic support.
🚀 Quick Start
Node.js
npm install @pratik_25/auth-sdk
import { AuthService, AuthServiceConfig } from '@pratik_25/auth-sdk';
const config: AuthServiceConfig = {
url: 'https://your-auth-service.com',
publicKey: 'your_public_key',
secretKey: 'your_secret_key'
};
const authService = new AuthService(config);
Python
pip install arvasit-auth-sdk
from auth_sdk import AuthService, AuthServiceConfig
config = AuthServiceConfig(
url="https://your-auth-service.com",
public_key="your_public_key",
secret_key="your_secret_key"
)
auth_service = AuthService(config)
📋 Available Methods
User Management
registerUser(data)- Register new userloginUser(data)- User loginlogoutUser(token)- User logoutrefreshToken(token)- Refresh access tokenverifyToken(token)- Verify token validity
Password Management
forgotPassword(email)- Send password resetresetPassword(data)- Reset passwordchangePassword(data)- Change passwordverifyPasswordReset(data)- Verify reset token
Two-Factor Authentication
enable2FA(userId)- Enable 2FAdisable2FA(userId)- Disable 2FAverify2FA(data)- Verify 2FA codegenerate2FABackupCodes(userId)- Generate backup codes
User Profile
getUserProfile(userId)- Get user profileupdateUserProfile(userId, data)- Update profiledeleteUser(userId)- Delete user account
Session Management
getActiveSessions(userId)- Get active sessionsrevokeSession(sessionId)- Revoke sessionrevokeAllSessions(userId)- Revoke all sessions
Verification
sendEmailVerification(email)- Send email verificationverifyEmail(data)- Verify emailsendPhoneVerification(phone)- Send phone verificationverifyPhone(data)- Verify phone
🔧 Configuration
Both SDKs support the same configuration:
interface AuthServiceConfig {
url: string; // Your auth service URL
publicKey: string; // Public API key
secretKey: string; // Secret API key
}
📚 Examples
See the examples/ directory for detailed usage examples.
📄 License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arvasit_auth_sdk-0.1.4.tar.gz.
File metadata
- Download URL: arvasit_auth_sdk-0.1.4.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
053898b9d6e515d633cf39e72135e555b434c904336797b3a38703b69cd35a0f
|
|
| MD5 |
23cb3599463c325b05a3262d84b107c3
|
|
| BLAKE2b-256 |
5e2d4fe6a4d345ace543ba80e9249411e86a2cd090898c77e15f39dc2f247297
|
File details
Details for the file arvasit_auth_sdk-0.1.4-py3-none-any.whl.
File metadata
- Download URL: arvasit_auth_sdk-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a382e7656dd94314ef56a907cbe433e5908a96b4afae64ce9a92d364ac7e85f9
|
|
| MD5 |
1f5e8258b7d191041a005ab5b9e30c06
|
|
| BLAKE2b-256 |
bf6be948f6b1f2a064d447582b1e5284879019cd7fad95ece52f797707424d7d
|