github ServiceNow/sdk v4.12.0
SDK 4.12.0

2 hours ago

@servicenow/sdk — Release Notes

Version: 4.12.0
Availability: npm — https://www.npmjs.com/package/@servicenow/sdk


🚀 Overview

Version 4.12.0 adds fixes and enhancements for AIUX, new Assessment APIs, expands the now-sdk auth and now-sdk cicd commands, and switches app installs to async by default. This release also improves OAuth session reliability and CI setup guidance, and includes fixes for attribute drops during transform, SPMenu widget parameter corruption, and expired-session handling during instance requests.


Assessments

New Assessment APIs
Fluent now supports defining Assessments and Risk Assessments directly in Fluent files, including post-deployment steps and conditions.

import { Assessment } from '@servicenow/sdk/core'

Assessment({
    $id: Now.ID['it-security-assessment'],
    name: 'IT Security Risk Assessment',
    evaluationMethod: 'assessment',
    table: 'cmdb_ci_service',
    description: 'Evaluates the security posture of IT services across key control areas.',
    scaleFactor: 10,
    roles: ['itil'],
    categories: [
        {
            $id: Now.ID['cat-access-control'],
            name: 'Access Control',
            description: 'Evaluate access management policies and practices.',
            weight: 50,
            order: 100,
            metrics: [
                {
                    $id: Now.ID['q-mfa-enabled'],
                    name: 'Multi-factor authentication enabled',
                    question: 'Is multi-factor authentication enforced for all privileged accounts?',
                    dataType: 'yesNo',
                    weight: 30,
                    order: 100,
                    mandatory: true,
                    correctAnswerYesNo: '1',
                },
            ],
        },
    ],
})

CLI

now-sdk auth --print
The auth command can now print a live, short-lived auth token for a stored credential (--format headers|bearer|env), for use in API calls outside the SDK such as curl.

now-sdk cicd test logs
A new logs subcommand fetches an ATF test result's captured logs, optionally filtered by a regular expression pattern — useful for pulling failure details out of a CI/CD pipeline run.

now-sdk cicd test logs --result-id <result_id> --pattern 'error|fail'

Async install by default
now-sdk install now defaults to asynchronous installs, with automatic fallback to synchronous installs when needed. This should reduce install timeouts for larger applications.

Attachments

Preserved image dimensions
image_width and image_height are now preserved when transforming from an attachment record, instead of being dropped.

Dependencies

ChoiceSet support in now-sdk dependencies
now-sdk dependencies now resolves ChoiceSet references, working around interface-merge limitations for out-of-box table choices that have changed on the platform since the base schema was captured.

Authentication & CI/CD

More reliable OAuth session handling
This fixes intermittent CSRF/session failures seen with OAuth client_credentials authentication. Check the CI Integration guide for more information and configuration.


Bug Fixes

Service Portal

  • Fixed SPMenu double-wrapping widgetParameters that were already wrapped in {value, displayValue} form, corrupting widget configuration. (#127)

Instance Connectivity

  • The SDK now retries once on an HTTP 401 during instance requests to recover from an expired session, instead of failing the operation outright.
  • Fixed CSRF token handling for non-OAuth credentials, restored alongside the session-cookie fix above.

Build Dependencies

  • Bumped the bundled isomorphic-rollup dependency, picking up several upstream Vite fixes and fixes for sourcemap support.

Don't miss a new sdk release

NewReleases is sending notifications on new releases.