ServiceNow SDK release notes

  • Release version: Xanadu
  • Updated August 1, 2024
  • 4 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of ServiceNow SDK release notes

    The ServiceNow® SDK enables developers to create and manage scoped applications locally using Visual Studio Code and to upload changes to a ServiceNow instance. The Xanadu release introduces enhancements that improve source code development with ServiceNow Fluent, a domain-specific language for defining application metadata. This update supports better integration with development environments, source control, and error detection at build time.

    Show full answer Show less

    Key Features

    • ServiceNow Fluent Language: Write application metadata as source code with APIs for various metadata types, enabling development in familiar environments.
    • Visual Studio Code Integration: Install the ServiceNow Fluent Language server for advanced language processing and validation.
    • Authentication: OAuth 2.0 support added for instance authentication via the now-sdk auth command.
    • Command Enhancements:
      • New parameters like project-type, template, debug, and reinstall allow customization of create, convert, fetch, and deploy operations.
      • Convert command defaults to module project type to support gradual migration of metadata to Fluent code.
      • Deprecated parameters such as scopeId and mode have been removed to streamline processes.
    • Configuration Updates: The modulePaths parameter replaces the deprecated transpiledSourceDir in now.config.json for mapping source to output directories in TypeScript projects.
    • Diagnostics Control: Suppress Fluent and TypeScript diagnostics with comment directives like @fluent-ignore and control synchronization with @fluent-disable-sync.
    • Table API Enhancement: Configure field labels in tables and columns using the label object.
    • Improved Application Structure: Default application layouts now include a .gitignore file and separate configuration files for better organization.

    Key Outcomes

    • Developers can efficiently build and maintain scoped applications entirely in source code, benefiting from modern code editors and source control tools.
    • Enhanced commands and parameters provide greater control over application creation, conversion, deployment, and debugging.
    • Improved authentication methods and diagnostics options increase security and developer productivity.
    • Migration to ServiceNow Fluent is simplified with incremental conversion workflows and better configuration management.
    • Removal of outdated parameters and streamlined commands reduce complexity and potential errors during development.

    Additional Information

    The ServiceNow SDK is distributed via npm and requires Node.js and npm installed locally. It integrates closely with the ServiceNow IDE, which uses the SDK for application packaging and provides Fluent APIs for source code development. For upgrading, use the now-sdk upgrade command to move to the latest version safely.

    The ServiceNow® software development kit (SDK) enables developers to create scoped applications in source code locally in Visual Studio Code Desktop and upload changes to a ServiceNow instance. ServiceNow SDK was enhanced and updated in the Xanadu release.

    ServiceNow SDK highlights for the Xanadu release

    Write source code to define the metadata that makes up applications with ServiceNow Fluent.

    See ServiceNow SDK for more information.

    Important information for upgrading ServiceNow SDK to Xanadu

    Upgrade to the latest version of the ServiceNow SDK with the now-sdk upgrade command. For more information, see Upgrade the ServiceNow SDK.

    Note:
    For more information about minor releases of the ServiceNow SDK, see the ServiceNow IDE, SDK, and Fluent articles in the ServiceNow Community.

    New in the Xanadu release

    Version 2.2.1
    Turn off synchronizing changes to ServiceNow Fluent code
    Turn off synchronizing changes to ServiceNow Fluent objects or files using the @fluent-disable-sync or @fluent-disable-sync-for-file comment directives.
    Version 2.1.1
    Authenticate to an instance using OAuth 2.0
    Authenticate to a ServiceNow instance using OAuth 2.0 by setting the type parameter on the now-sdk auth command to oauth.
    Ignore ServiceNow Fluent diagnostics
    Suppress ServiceNow Fluent and TypeScript diagnostics using the @fluent-ignore comment directive.
    Version 2.0
    Build scoped applications in source code
    Write source code to define the metadata that makes up applications using ServiceNow Fluent. ServiceNow Fluent is a domain-specific programming language with APIs for defining the different types of application metadata. Developing applications in source code enables you to work in familiar development environments, create and modify complex applications, manage code in source control more easily, and catch errors at build time.
    ServiceNow Fluent Language server in Visual Studio Code
    Get language processing and validation for ServiceNow Fluent in Visual Studio Code by installing the ServiceNow Fluent Language server from the Visual Studio Code Marketplace.

    Changed in this release

    Version 2.2.3
    Convert command uses module project type by default
    The projectType parameter is set to module by default. By converting an application with the module project type, you can gradually migrate application metadata into ServiceNow Fluent code rather than converting all application metadata into code initially.
    Version 2.2.1
    transpiledSourceDir parameter replaced with modulePaths parameter in now.config.json file
    Use the modulePaths parameter in the now.config.json file for your application to map the source directory for modules to the output directory for modules instead of the deprecated transpiledSourceDir parameter. The modulePaths parameter is used to compile TypeScript source files into JavaScript modules.
    Version 2.1.1
    Table API includes label object
    Configure field labels [sys_documentation] for tables and columns with the label object in the Table API.
    Version 2.0.1
    Create and convert commands include template parameter
    Specify whether to use JavaScript or TypeScript in modules with the template parameter on the now-sdk create and now-sdk convert commands. This parameter determines the configuration of the package.json and now.config.json files and adds a tsconfig.json file for TypeScript projects.
    Version 2.0
    Default application structure
    The default application structure includes some changes to directories and files, including the addition of a .gitignore file and moving the now object configuration in package.json to its own now.config.json file.
    Create and convert commands include project-type parameter
    Specify the type of application to create or convert with the project-type parameter on the now-sdk create and now-sdk convert commands. This parameter determines the default application structure based on whether you want to use ServiceNow Fluent and JavaScript modules and third-party libraries in the application (fluent) or only use JavaScript modules and third-party libraries (module).
    Fetch command includes debug parameter
    Return debug logs generated during the fetch process by setting the debug parameter to true with the now-sdk fetch command.
    Deploy command includes reinstall parameter
    Uninstall and reinstall the application on the instance by setting the reinstall parameter to true with the now-sdk deploy command. Reinstalling an application ensures that the metadata on the instance matches the metadata in the deployment package.
    Warning:
    Metadata that is on the instance but not in your local application is removed.

    Removed in this release

    • The scopeId parameter was removed from the now-sdk convert command, which supported converting global applications. Only scoped applications can be converted.
    • The mode parameter was removed from the now-sdk fetch and now-sdk deploy commands. A complete fetch or deploy are always executed.

    Activation information

    The ServiceNow SDK is available as an npm package from the public npm registry and installed locally. For information about installing the ServiceNow SDK, see Install the ServiceNow SDK in an application.

    Additional requirements

    You must have Node.js and npm installed to install the ServiceNow SDK. For more information, see Install the ServiceNow SDK in an application.