0.1.5 • Published 2 years ago

app-services-admin-sdk v0.1.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Atlas App Services Admin SDK

This is not an official MongoDB-supported project.

SDK for Atlas Atlas App Services administration. This SDK is a wrapper around the App Services Admin API.

Install

npm install app-services-admin-sdk

Usage

Instantiate an SDK client:

import {
  AppServicesTokenCredential,
  AtlasAppServicesAPI,
} from "app-service-admin-sdk";

const { PUBLIC_KEY, PRIVATE_KEY, GROUP_ID, APP_ID } = process.env;
const creds = new AppServicesTokenCredential(PUBLIC_KEY, PRIVATE_KEY);
const apiClient = new AtlasAppServicesAPI(creds, GROUP_ID, APP_ID);

Use the client to query the Admin API:

const secretRequestBody = {
  name: "helloooo",
  value: "world",
};
const res = await apiClient.adminCreateASecret(secretRequestBody);
console.log(res);
/*
The console.log statement will print:

{ id: '<Some App Id>', name: 'helloooo' }
*/
0.1.5

2 years ago

0.1.4

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

1.0.0

2 years ago