npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

appollo

v0.1.13

Published

The official package for the Appollo platform

Readme

Appollo SDK

Build Status

The Appollo SDK helps developers build a single eCommerce app that will be published across many eCommerce platforms through the Appollo platform.

The SDK includes methods for working with a merchant's:

  • Products
  • Orders
  • Customers
  • Collections
  • Variants
  • Billing (Charging for your app)

Installation using npm (recommended):

Run this command to install the package and adding it to your package.json:

$ npm install appollo --save

Usage:

Initializing

Import the module to get a constructor function for an Appollo object, then call it with new to instantiate an Appollo object with your own API Key and API Secret.

const Appollo = require("appollo");
const appollo = new Appollo(apiKey, apiSecret);

Merchant ID (Important)

Almost all methods will require a merchant ID. The merchant ID is the unique identifier for a merchant's store.

With Appollo you no longer have to worry about writing a new installation server for each platform you decide to distribute your app to. When a merchant attempts to install your app. we securely handle OAuth authentication for you, then redirect the merchant to your sign-up URL.

This is the sign-up url you provide through our dashboard. This is the url of your sign-up page.

When we redirect we will append some useful information as query parameters so that you can identify the user. You should parse these query parameters and save them.

Here's how you might parse the params:

const urlParams = new URLSearchParams(window.location.search);
const email = urlParams.get('merchant_email')
console.log(email);
// [email protected]

const name = urlParams.get('merchant_name')
console.log(name);
// John Doe

const siteDomain = urlParams.get('merchant_shop')
console.log(siteDomain);
// empty woolworths.myshopify.com

const merchantId = urlParams.get('appollo_merchant_id')
console.log(storeId);
// storeId

Once a user installs your app, they are redirected to your sign-up page. You should make sure to prefill the sign-up form with the merchant's email (and name where applicable).

Make sure to save the merchantId to the user, so you can use it later.

Products

If your app interacts with a merchant's products, you can use our various methods to create, read, update and delete products.

When creating a product, you should use the following structure: | Property | Type | Description | | ------ | ------ | ---- | | description* | string | Description of the product. | title* | string | The title of the product. | type | string | Categorisation of the product | variants | array | Array of product variants. | media | array | Array of media objects. | tags | array | Store tags of the product. | brand | string | The brand of the product. | price | float | The price of the product. | weight | float | The weight of the product

The methods you can use for products are the following:

const Appollo = require("appollo");
const appollo = new Apppollo(apiKey, apiSecret);

appollo.getProducts(merchantId, limit, page)
.then(res => console.log(res))
// Get a list of products from a merchants store

appollo.getProduct(merchantId, productId)
.then(res => console.log(res))
// Get a particular product from a merchant store

appollo.createProduct(merchantId, product)
.then(res => console.log(res))
// Create a product within a merchant store

appollo.updateProduct(merchantId, product, productID)
.then(res => console.log(res))
// Update a product within a merchant store

appollo.deleteProduct(merchantId, productID)
.then(res => console.log(res))
// Delete a product within a merchant store

Orders

If your app interacts with a merchant's orders, you can use our various methods to create, read, update and delete orders.

When creating an order, you should use the order object structure given in https://docs.tryappollo.com/reference#create-order

The methods you can use for products are the following:

const Appollo = require("appollo");
const appollo = new Appollo(apiKey, apiSecret);

appollo.getOrders(merchantId, limit, page)
.then(res => console.log(res))
// Get a list of orders from a merchants store

appollo.getOrder(merchantId, orderId)
.then(res => console.log(res))
// Get a particular order from a merchant store

appollo.createOrder(merchantId, order)
.then(res => console.log(res))
// Create an order within a merchant store

appollo.updateOrder(merchantId, order, orderID)
.then(res => console.log(res))
// Update an order within a merchant store

appollo.deleteProduct(merchantId, orderID)
.then(res => console.log(res))
// Delete an order within a merchant store

Customers

If your app interacts with a merchant's customers, you can use our various methods to create, read, update and delete customers.

When creating a customer, you should use the customer object structure given in https://docs.tryappollo.com/reference#create-customer

The methods you can use for products are the following:

const Appollo = require("appollo");
const appollo = new Appollo(apiKey, apiSecret);

appollo.getCustomers(merchantId, limit, page)
.then(res => console.log(res))
// Get a list of customers from a merchants store

appollo.getCustomer(merchantId, customerId)
.then(res => console.log(res))
// Get a particular customer from a merchant store

appollo.createCustomer(merchantId, customer)
.then(res => console.log(res))
// Create a customer within a merchant store

appollo.updateCustomer(merchantId, customer, customerID)
.then(res => console.log(res))
// Update a customer within a merchant store

appollo.deleteCustomer(merchantId, customerID)
.then(res => console.log(res))
// Delete a customer within a merchant store

Collections

A commonly used API is the Collections API. A collection is a group of products that are commonly displayed together. An example is "Summer clothing" or "Streetwear".

If your app interacts with a merchant's collections, you can use our various methods to create, read, update and delete collections.

When creating a collection, you should use the collection object structure given in https://docs.tryappollo.com/reference#create-collection

The methods you can use for collections are the following:

const Appollo = require("appollo");
const appollo = new Appollo(apiKey, apiSecret);

appollo.getCollections(merchantId, limit, page)
.then(res => console.log(res))
// Get a list of collections from a merchants store

appollo.getCollection(merchantId, collectionId)
.then(res => console.log(res))
// Get a particular collection from a merchant store

appollo.createCollection(merchantId, collection)
.then(res => console.log(res))
// Create a collection in a merchant store

appollo.updateCollection(merchantId, collection, collectionID)
.then(res => console.log(res))
// Update a collection within a merchant store

appollo.deleteCollection(merchantId, collectionID)
.then(res => console.log(res))
// Delete a collection within a merchant store

appollo.addProductsToCollection(merchantId, products, collectionID)
.then(res => console.log(res))
// Add a list of products to a collection

appollo.removeProductsFromCollection(merchantId, products, collectionID)
.then(res => console.log(res))
// Remove a list of products from a collection

Variants

A commonly used API is the Variants API. A variant is a particular version of a product within a store. For example the product could be "Summer dress" and a variant would be the "Red Summer Dress".

If your app interacts with a merchant's variants, you can use our various methods to create, read, update and delete variants.

When creating a variant, you should use the variant object structure given in https://docs.tryappollo.com/reference#create-variant

The methods you can use for variants are the following:

const Appollo = require("appollo");
const appollo = new Appollo(apiKey, apiSecret);

appollo.getVariants(merchantId, productId, limit, page)
.then(res => console.log(res))
// Get a list of variants from a merchants store

appollo.getVariant(merchantId, productId, variantId)
.then(res => console.log(res))
// Get a particular variant from a merchant store

appollo.createVariant(merchantId, variant, productId)
.then(res => console.log(res))
// Create a variant of a product in a merchant store

appollo.updateVariant(merchantId, variant, productId, variantId)
.then(res => console.log(res))
// Update a variant within a merchant store

appollo.deleteVariant(merchantId, productId, variantId)
.then(res => console.log(res))
// Delete a variant of a product within a merchant store

Charging for your app

A commonly used API is the Billing API.

If you plan to launch a paid app to either Wix or Shopify (or both), you will need to use the Appollo billing API.

The billing API returns a checkout url, you should redirect your users to this url where they will be asked to pay for your app at the platform.

There are two possible ways you can charge your app users, either through our recurringCharge or singleCharge method. You should make sure to set the pricing of your app within the Appollo dashboard.

You should also make sure to get the unique ChargeId for each price from the Appollo dashboard.

The methods you can use for billing are the following:

const Appollo = require("appollo");
const appollo = new Appollo(apiKey, apiSecret);

appollo.createSingleCharge(merchantId, chargeId)
.then(res => console.log(res))
// Get a checkoutUrl for a single charge

appollo.createRecurringCharge(merchantId, chargeId)
.then(res => console.log(res))
// Get a checkoutUrl for a recurring charge

Documentation

Reference documentation is available at: https://docs.tryappollo.com

Getting help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know at [email protected]