To help you build New Relic One applications, we provide you with the New Relic One SDK. Here we give you an introduction to the types of API calls and components in the SDK. The SDK provides everything you need to build your Nerdlets, create visualizations, and fetch New Relic or third-party data.
SDK components are located in the Node module package named
nr1, which you get when you install the NR1 CLI. The
nr1 components can be divided into several categories:
- UI components
- Chart components
- Query and storage components
- Platform APIs
The UI components category of the SDK contains React UI components, including:
Layout components: These components give you control over the layout, and help you build complex layout designs without having to deal with the CSS. Layout components include:
Overlaid components: These components are used to display contextual information and options in the form of an additional child view that appears above other content on screen when an action or event is triggered. They can either require user interaction (like modals), or be augmenting (like a tooltip). These include:
The Charts category of the SDK contains components representing different types of charts. The
component helps a group of related charts share data and be aligned.
Some chart components can perform NRQL queries on their own; some accept a customized set of data.
The Query components category contains components for fetching and storing New Relic data.
The main way to fetch data is with NerdGraph, our GraphQL endpoint. This can be queried using
NerdGraphQuery. To simplify use of NerdGraph queries, we provide some components with pre-defined queries. For more on using NerdGraph, see Queries and mutations.
We also provide storage for storing small data sets, such as configuration settings data, or user-specific data. For more on this, see NerdStorage.
The Platform API components of the SDK enable your application to interact with different parts of the New Relic One platform, by reading and writing state from and to the URL, setting the configuration, etc. They can be divided into these categories:
PlatformStateContext: provides read access to the platform URL state variables. Example:
timeRangein the time picker.
navigation: an object that allows programmatic manipulation of the navigation in New Relic One. Example: opening a new Nerdlet.
NerdletStateContext: provides read access to the Nerdlet URL state variables. Example: an
entityGuidin the entity explorer.
nerdlet: allows you to configure your Nerdlet and write to your Nerdlet's URL state.