@stackfactor/client-api
v1.1.194
Published
Node.js library for the StackFactor API
Readme
@stackfactor/client-api
A TypeScript/JavaScript client library for interacting with the StackFactor API. This package provides a comprehensive set of modules for managing users, skills, roles, teams, training plans, assessments, and more — designed for use in web and Node.js applications.
Features
- User Management — account creation, authentication (login, logout, token refresh), API tokens, invitations, email/phone confirmation, password reset
- Skills & Roles — create, publish, import from templates, assign to users
- Teams & Groups — create and manage organizational structures
- Training Plans — create, publish, archive, manage proficiency levels and activities
- Skill Assessments — create assessments, manage testing sessions
- AI Assistant — start conversations, ask questions, voice assistant
- Content Generation — synchronous and asynchronous AI-powered content generation
- Learning Content & Paths — author and manage learning materials
- Dashboard, Notifications, Security — configurable dashboard cards, action notifications, auth connections and MFA
Installation
npm install @stackfactor/client-apiUsage
Import the modules you need from the library:
import { users, skill, role, team, address } from "@stackfactor/client-api";
// Login
users
.login("[email protected]", "password")
.then((data) => console.log(data))
.catch((err) => console.error(err));
// Create a skill
skill
.createSkill({ name: "TypeScript" }, authToken)
.then((result) => console.log(result));
// Address autocomplete
address
.autoComplete("123 Main St", authToken)
.then((result) => console.log(result));Available Modules
| Import Name | Description |
| ------------------------------- | ------------------------------------- |
| actionNotifications | User action notifications |
| address | Address validation and autocomplete |
| aiAssistant | AI assistant conversations and voice |
| avatar | User and element avatars |
| client | Configured Axios HTTP client instance |
| config | Platform configuration |
| contentGenerator | AI-powered content generation |
| customFields | Custom field definitions |
| dashboard | Dashboard card management |
| departmentTraingPlans | Department training plans |
| groups | User group management |
| integration | Integration management |
| integrationConfiguration | Integration configuration |
| learningContent | Learning content authoring |
| learningPath | Learning path management |
| logger | Logging utilities |
| microSkillsQuizes | Micro-skill quiz management |
| quotas | Usage quotas |
| role | Role management |
| roleTemplate | Role template management |
| security | Auth connections, MFA, Auth0 sync |
| skill | Skill management |
| skillAssessment | Skill assessment management |
| skillAssessmentTestingSession | Assessment testing sessions |
| skillTemplate | Skill template management |
| talentTransfromation | Talent transformation tracking |
| team | Team management |
| tenant | Tenant settings |
| trainingPlan | Training plan management |
| trainingPlanProficiencyLevel | Training plan proficiency levels |
| userInformation | User business profile properties |
| users | User accounts and authentication |
Constants DOCUMENT_VERSION, RESPONSE_TYPE, PERMISSIONS, and PERMISSION_DESCRIPTIONS are also exported directly.
Utility functions errorToString, getErrorType, getErrorInformation, and shouldReturnError are exported at the top level for Axios error handling.
Documentation
Full method-level documentation for each module is available in the doc/ folder:
- Action Notifications
- Address
- AI Assistant
- Avatar
- Axios Client
- Config
- Constants
- Content Generator
- Custom Fields
- Dashboard
- Department Training Plans
- Groups
- Integration
- Integration Configuration
- Learning Content
- Learning Path
- Logger
- Micro Skills Quizzes
- Quotas
- Role
- Role Template
- Security
- Skill
- Skill Assessments
- Skill Assessment Testing Session
- Skill Template
- Talent Transformation
- Teams
- Tenants
- Training Plans
- Training Plans Proficiency Levels
- User Information
- Users
- Utils
License
This package is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0). See the LICENSE file for details.
Support
For questions or support, open an issue in the GitHub repository.
