@applica-software-guru/persona-iam-sdk
v0.1.0
Published
Framework-neutral TypeScript SDK for Persona IAM
Readme
@applica-software-guru/persona-iam-sdk
Framework-neutral TypeScript SDK for Persona IAM. It provides authentication and typed services for users, tenants, projects, roles, and devices without React or React Admin dependencies.
Installation
npm install @applica-software-guru/persona-iam-sdkUsage
import { AuthThirdPartyProviders, createIamClient } from '@applica-software-guru/persona-iam-sdk/core';
const iam = createIamClient({ apiUrl: 'https://persona.applica.guru/iam' });
await iam.auth.login({ username: '[email protected]', password: 'secret' });
await iam.auth.thirdPartyLogin({ provider: AuthThirdPartyProviders.GOOGLE, payload: {} });
const result = await iam.users.search({
projectId: 'project-id',
pageable: { pageNumber: 0, pageSize: 20 }
});The package root and ./core expose the same framework-neutral API. projectId filters users by project membership; authorization remains enforced by the IAM backend.
Authentication
Bearer tokens are persisted through LocalStorage by default in browsers. Pass MemoryStorage or another IStorage implementation for server-side code and tests. A system API key can be supplied through createIamClient({ apiUrl, apiKey }) for authorized management endpoints; never embed that key in browser bundles.
Documentation
Service and type documentation is available under docs/.
Optional authentication integration tests require IAM_INTEGRATION_API_URL, IAM_INTEGRATION_USERNAME, and IAM_INTEGRATION_PASSWORD and run only through npm run test:integration. The default test suite is fully offline.
Origin
This repository is a native fork of applicaguru/iam-client, created from main commit 256b466a415996882e60edce35345a3d829cae9d. It preserves the inherited history but follows an autonomous development path and is not synchronized with upstream.
License
MIT. See LICENSE.
