Socket
Book a DemoInstallSign in
Socket

@designcontainer/dc-wpe-js-api

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@designcontainer/dc-wpe-js-api

A javascript wrapper for the WPE Api

1.2.2
latest
Source
npmnpm
Version published
Weekly downloads
22
Maintainers
3
Weekly downloads
 
Created
Source

JavaScript wrapper for the WP Engine API

A simple JavaScript wrapper for getting data from your WP Engine installs using their API.

Installing

$ npm install @designcontainer/dc-wpe-js-api

Import

import WpeApi from '@designcontainer/dc-wpe-js-api';

Initialize constructor

Params

  • user {String}: The WP Engine API User.
  • pass {String}: The WP Engine API Password/key.

You should put these variables in a .ENV file!

const wpe = new WpeApi(user, pass);

API

.id

Get WP Engine install ID by name.

Params

  • name {String}: The WP Engine install Name.
  • returns {String}: Returns the WP Engine install ID.

Example

wpe.id(name);

.name

Get WP Engine install name by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the WP Engine install name.

Example

wpe.name(id);

.domains

Get WP Engine install domains by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {Array}: Returns the WP Engine install domains.

Example

wpe.domains(id);

.phpVersion

Get the PHP version of the WP Engine install by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the PHP version of the WP Engine install.

Example

wpe.phpVersion(id);

.status

Get the status of the WP Engine install by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the status of the WP Engine install.

Example

wpe.status(id);

.cname

Get the CNAME of the WP Engine install by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the CNAME of the WP Engine install.

Example

wpe.cname(id);

.environment

Get the WP Engine install environment by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the WP Engine install environment.

Example

wpe.environment(id);

.primaryDomain

Get WP Engine primary install domain by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {String}: Returns the WP Engine install primary domain.

Example

wpe.primaryDomain(id);

.isMultisite

Check if WP Engine install is a multisite environment by id.

Params

  • id {String}: The WP Engine install ID.
  • returns {Boolean}: Returns boolean true/false depending on if install is a multisite environment.

Example

wpe.isMultisite(id);

.newBackup

Creates a new WP Engine Backup by id.

Params

  • id {String}: The WP Engine install ID.
  • description {String}: Backup description.
  • notification_emails {Array}: Backup notification email addresses.
  • returns {Boolean}: Returns backup response. Example
wpe.newBackup(id, description, notification_emails);

.getWpeApi

Get custom WP Engine data.

Params

  • ...args {Any}: Api arguments. Docs: https://wpengineapi.com.
  • returns {Object}: Returns api data.

Examples

wpe.getWpeApi('installs', { limit: 10 })
	.then((res) => {
		console.log(res);
	})
	.catch((err) => console.error(`Error: ${err}`));
wpe.getWpeApi('installs', id, 'domains')
	.then((res) => {
		console.log(res);
	})
	.catch((err) => console.error(`Error: ${err}`));

.postWpeApi

Post custom WP Engine data.

Params

Examples

wpe.postWpeApi('installs', id, 'backups', {
	description,
	notification_emails,
})
	.then((res) => {
		console.log(res);
	})
	.catch((err) => console.error(`Error: ${err}`));

FAQs

Package last updated on 19 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.