Exploring the ServiceNow SDK
Summarize
Summary of Exploring the ServiceNow SDK
The ServiceNow SDK enables users to develop applications locally in Visual Studio Code and install them on a non-production instance starting with the Washington DC release. This allows for offline development and access to Visual Studio Code features not available in the ServiceNow IDE.
Show less
Key Features
- Local Development: Create and modify applications using ServiceNow Fluent for defining application metadata, write custom JavaScript modules, and add third-party libraries.
- Command-Line Interface (CLI): Manage changes between your local application and the instance with commands for authentication, application creation, and metadata transformation.
- Application Packaging: The SDK serves as a packaging service that builds applications within the ServiceNow IDE.
Key Outcomes
By utilizing the ServiceNow SDK, developers can:
- Work offline and manage applications using source control in Visual Studio Code.
- Define application metadata and create reusable code within the application's scope.
- Keep applications synchronized with the instance through metadata transformations.
- Collaborate effectively by cloning applications from remote Git repositories for development on other systems.
Learn about developing applications in source code locally and installing changes on an instance with the ServiceNow SDK.
ServiceNow SDK overview
With the ServiceNow SDK, you can create and modify applications locally in Visual Studio Code Desktop and install those applications on a non-production instance beginning with the Washington DC release. By developing applications locally, you can work offline and use features that are available in Visual Studio Code but not in the ServiceNow IDE.
In Visual Studio Code, you can develop applications in source code using ServiceNow Fluent to define application metadata [sys_metadata], write custom JavaScript modules, or add third-party libraries.
The ServiceNow SDK includes a command-line interface (CLI) for managing changes between an instance and a local application. Using simple CLI commands, you can authenticate to an instance, create or convert an application, transform application metadata (XML) into ServiceNow Fluent code, build and install the application on the instance, and more.
The ServiceNow SDK also serves as the application packaging service that builds applications in the ServiceNow IDE. For more information, see Exploring the ServiceNow IDE.
ServiceNow SDK workflow
The following infographic shows the workflow for developers to get started developing applications with the ServiceNow SDK.
- A developer installs the ServiceNow SDK locally. For more information, see Install the ServiceNow SDK in an application.
- Using the CLI, the developer authenticates to a non-production instance to interface between their local environment and the instance with the
now-sdk authcommand. The developer must have the admin role on the instance. - The developer creates an application (
now-sdk init) or converts an existing application from the instance (now-sdk init --from) for use with the ServiceNow SDK. - In Visual Studio Code, the developer can define application metadata in source code using ServiceNow Fluent, create custom JavaScript modules, or use third-party libraries.
They can also download application and script dependencies from the instance to code against (
now-sdk dependencies). - The developer builds the application, which compiles the source code and transforms it into application metadata for the instance (
now-sdk build). - The developer installs the application on the instance (
now-sdk install). - Other users can continue to modify the application metadata on the instance, and developers can reuse the code from modules in other modules or scripts within the application.
- The developer downloads and transforms application metadata from the instance to get the latest updates to the application metadata locally (
now-sdk transform), keeping it synchronized with the application on the instance.
You can manage applications in source control with your preferred Git provider. To develop an application on another system with the ServiceNow SDK, other developers should clone the application from a remote GIt repository rather than downloading and transforming it from the instance.
ServiceNow SDK benefits
| Benefit | Feature | Users |
|---|---|---|
| Develop applications offline, outside of an instance in Visual Studio Code and manage them in source control with your preferred Git provider. | Developing applications with the ServiceNow SDK | Developers |
| Write source code to define the metadata that makes up ServiceNow applications | ServiceNow Fluent | Developers |
| Organize and reuse code within an application scope with custom JavaScript modules and third-party JavaScript utilities | JavaScript modules and third-party libraries | Developers |