@servicenow/sdk
v1.0.6
Published
ServiceNow SDK CLI
Downloads
77
Keywords
Readme
ServiceNow SDK
Use the ServiceNow software development kit (SDK) to add JavaScript modules and third-party libraries to applications locally and upload changes to an instance of the Now Platform.
Overview
With the ServiceNow SDK, developers can create and modify scoped applications with custom modules and third-party libraries in Visual Studio Code and deploy those applications to a non-production instance on the Washington DC release. Writing ServiceNow applications outside of a ServiceNow instance enables you to use industry-standard development practices and familiar tools and catch errors at build-time rather than at run-time only.
For more information see the SDK Overview documentation or the CLI Overview
Installation
Install the ServiceNow software development kit (SDK) locally using Node Package Manager (npm).
Before you begin
Your system must meet the following requirements to use npm to install the SDK:
- Node.js v16.16.0 or later
- npm v8.11.0 or later
To install or upgrade Node.js or npm, see the installation instructions on the npm website.
Procedure
- Open a command-line tool on your system.
- Verify that your system meets the requirements.
a. Enter
node –v
to check if you have Node.js installed and which version. b. Enternpm –v
to check if you have npm installed and which version. - Enter the following command to install the SDK:
npm install --global @servicenow/sdk
Usage
Authentication
Authenticate with a ServiceNow instance using a user account with an admin
role.
now-sdk auth save default
View credentials saved in the device keychain or credential manager on your system.
now-sdk auth list
Creating an app
Create a new scoped application, optionally including a sample table.
Note: Replace {vendorprefix}
with your organization's unique scope prefix.
now-sdk create sdk_demo x_{vendorprefix}_demo --sampleTable
Building code changes
Compile source files and generate a deployable package. Third-party library dependencies are converted into XML files that can be installed with the application.
now-sdk build
Deploying app updates
Deploy an application to an instance. Before using the deploy command, you must use the build command to generate a deployable package.
now-sdk deploy
Synchronizing changes from the instance
Download application metadata from an instance and update the metadata XML files in your local application to match.
now-sdk fetch
What to do next
Use the ServiceNow SDK to create a scoped application or convert an existing application for use with the SDK. For more information, see Create or convert an application with the ServiceNow SDK.