This document covers upgrading between major and minor versions of @okta/okta-sdk-nodejs.
Version 8.1.0 contains no breaking API changes. The following TypeScript type corrections may require minor updates in TypeScript codebases:
The type property on the five IdentityProviderProtocol subtypes (ProtocolOidc, ProtocolSaml, ProtocolMtls, ProtocolOAuth, ProtocolIdVerification) is now correctly marked as required (was incorrectly optional due to a code-generator bug). This matches the Okta API spec.
If your TypeScript code constructs a Protocol object without an explicit type field, add the appropriate discriminant literal:
// Before (compiled without error in 8.0 even though 'type' was required by the API)
const protocol: ProtocolOidc = { /* no type field */ };
// After (8.1) — add the required discriminant
const protocol: ProtocolOidc = { type: 'OIDC', /* ... */ };The TypeScript type of the properties field has changed from ProfileMappingProperty (single object, incorrect) to { [key: string]: ProfileMappingProperty } (map, correct). This was a bug fix — the old type caused all custom attribute keys to be silently dropped when serializing.
// Before (8.0) — incorrect type caused silent data loss at runtime
const request: ProfileMappingRequest = {
properties: { expression: 'user.login', pushStatus: 'PUSH' } as ProfileMappingProperty
};
// After (8.1) — correct map type, custom attributes are preserved
const request: ProfileMappingRequest = {
properties: {
login: { expression: 'user.login', pushStatus: 'PUSH' },
email: { expression: 'user.email', pushStatus: 'PUSH' }
}
};Version 8.0 includes several breaking changes due to updates in the Okta OpenAPI specification:
The EmailTestAddresses model has been updated with renamed properties:
Old (v7.x):
await client.emailServerApi.testEmailServer({
emailServerId: emailServer.id,
emailTestAddresses: {
_from: 'test@example.com',
to: 'recipient@example.com'
}
});New (v8.0):
await client.emailServerApi.testEmailServer({
emailServerId: emailServer.id,
emailTestAddresses: {
fromAddress: 'test@example.com', // Changed from '_from'
to: 'recipient@example.com'
}
});The CustomRole model has been renamed to IamRole:
Old (v7.x):
import { CustomRole } from '@okta/okta-sdk-nodejs';
let customRole: CustomRole;New (v8.0):
import { IamRole } from '@okta/okta-sdk-nodejs';
let customRole: IamRole; // Changed from CustomRoleThe AssignRoleRequest model has been renamed to StandardRoleAssignmentSchema:
Old (v7.x):
import { AssignRoleRequest } from '@okta/okta-sdk-nodejs';
const roleRequest: AssignRoleRequest = {
type: 'USER_ADMIN'
};
await client.userApi.assignRoleToUser({
userId: user.id,
assignRoleRequest: roleRequest
});New (v8.0):
import { StandardRoleAssignmentSchema } from '@okta/okta-sdk-nodejs';
const roleRequest: StandardRoleAssignmentSchema = { // Changed from AssignRoleRequest
type: 'USER_ADMIN'
};
await client.userApi.assignRoleToUser({
userId: user.id,
assignRoleRequest: roleRequest
});- AgentConnectionsApi — Manage agent connections
- AgentPotentialConnectionsApi — Discover potential agent connections
- AgentPublicKeyApi — Manage agent public keys
- AgentRegistrationApi — Handle agent registration
- ApplicationCrossAppAccessConnectionsApi — Manage cross-app access connections
- ApplicationInterclientTrustMappingsApi — Configure interclient trust mappings
- ApplicationSSOPublicKeysApi — Manage application SSO public keys
- AssociatedDomainCustomizationsApi — Customize associated domains
- CustomTelephonyProviderApi — Configure custom telephony providers
- GroupPushMappingApi — Manage group push mappings
- OAuth2ResourceServerCredentialsKeysApi — Manage OAuth2 resource server credentials
- OktaManagedUserAccountApi — Manage Okta managed user accounts
- OperationsIntegrationApi — Handle operations integrations
- UserAuthenticatorEnrollmentsApi — Manage user authenticator enrollments
- ApplicationApi — Enhanced with additional methods for improved application management
- AuthenticatorApi — Expanded authenticator management capabilities
- IdentitySourceApi — Significantly enhanced with extensive new methods for identity source operations
- YourOinIntegrationsApi — Enhanced integration management features
- Methods are invoked on scoped clients
- Method params are passed as a single object
- Models no longer have CRUD methods
- Methods which return
Collectionbecome async - Enums are replaced with union types
- Model properties are optional
- await client.getUser('ausmvdt5xg8wRVI1d0g3')
+ await client.userApi.getUser({ userId: 'ausmvdt5xg8wRVI1d0g3' })- await user.deactivate()
+ await client.userApi.deactivateUser({ userId: user.id })Enum types from the spec are accounted for: respective JS models are converted to enum-like modules.
Following Client method signatures have changed:
listPoliciesreturnsPromise<Policy>activateNetworkZonereturnsPromise<NetworkZone>deactivateNetworkZonereturnsPromise<NetworkZone>listGroupsno longer acceptsfilterparameter throughqueryParameters
The version 5.0 of this SDK dropped support for Node 10, which is EOL (End-of-Life) since 2021-04-30. Current supported minimal Node version is 12.0.0.
Following Client method signatures have changed:
createAuthorizationServerPolicy: addedauthorizationServerPolicy: AuthorizationServerPolicyOptionsparameterlistAuthorizationServerPolicies: returnsCollection<AuthorizationServerPolicy>getAuthorizationServerPolicy: returnsPromise<AuthorizationServerPolicy>updateAuthorizationServerPolicy: second parameter type changed toAuthorizationServerPolicyOptions, returnsPromise<AuthorizationServerPolicy>listPoliciesreturnsPromise<AuthorizationServerPolicy>
Following models' method signatures have changed:
AuthorizationServer
Change details are listed in CHANGELOG.md.
All required method parameters in Client are now checked at runtime in JS code.
The version 4.0 of this SDK dropped support for Node 8, which is EOL (End-of-Life) since 2019-12-31. Current supported minimum Node version is 10.0.0.
This version 4.0 release also updated APIs to the latest @okta/openapi (v2.0.0) which includes added, changed and deprecated factories/models/client methods. Change details are listed in CHANGELOG.md. For each change item:
Add— newly added factories/models/client methods.Change(breaking changes) — renamed factories/models/client methods.Remove(breaking changes) — deprecated factories/models/client methods.
- Renamed
Factorrelated factories/models/client methods toUserFactor - Renamed
client.sessionApi.endAllUserSessionstoclient.sessionApi.clearUserSessions - Model and Client methods change for
Userrelated operations - Model and Client methods change for
Rulerelated operations