@launchnotes/moments-api-client
v1.1.6
Published
Client that allows you to interface with the Moments API.
Downloads
12
Keywords
Readme
Moments API Client
Client that allows you to interface with LaunchNotes' Moments API.
Installing the client
# via yarn
yarn add @launchnotes/moments-api-client
# via npm
npm i @launchnotes/moments-api-client
Using the client to create Moments
The client is based off of OpenAPI's typescript-axios
generator. You will
first have to create a Configuration
instance with your API key and create
a MomentsApi
instance with that config.
From there, you should be able to make POST requests to the Moments API using MomentsApi.postMoments()
.
import {
MomentsApi,
PostMomentsRequest,
Configuration,
} from '@launchnotes/moments-api-client';
const config = new Configuration({
accessToken: 'manage_abc123',
basePath: 'https://pathtoapi.local:8080',
})
const api = new MomentsApi(config);
const request: PostMomentsRequest = {
schemaId: 'https://schema.launchnotes.dev/schemas/test.json',
projectId: 'pro_abc123',
data: {},
};
const response = api.postMoments(request).then((result) => {
console.log(result);
}).catch((error) => {
console.log(error);
});
OpenAPI generator and Axios
The client was generated by OpenAPI's typescript-axios
generator using an
OpenAPI spec YAML file. For more information, please refer to these articles: