# @ansugroup/isolate-shopify-api

> Isolate Shopfy API - Wrap Shopify API and make it isolate

Latest version **0.1.6** (published 2021-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ansugroup/isolate-shopify-api
pnpm add @ansugroup/isolate-shopify-api
yarn add @ansugroup/isolate-shopify-api
bun add @ansugroup/isolate-shopify-api
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2021-11-22 |
| First published | 2021-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | pierreneter |
| Maintainers | pierreneter |
| Keywords | shopify, api, isolate |

## Links

- npm: https://www.npmjs.com/package/@ansugroup/isolate-shopify-api
- Homepage: https://github.com/ANSUGroup/shopify/tree/main/packages/isolate-shopify-api
- Issues: https://github.com/ANSUGroup/shopify
- npm.io page: https://npm.io/package/@ansugroup/isolate-shopify-api

## Dependencies (1)

- [@shopify/shopify-api](https://npm.io/package/@shopify/shopify-api.md) ^2.0.0

## Recent versions

- 0.1.6 (latest) — 2021-11-22
- 0.1.5 — 2021-11-12
- 0.1.3 — 2021-08-16
- 0.1.2 — 2021-08-16

## README

# [`@ansugroup/isolate-shopify-api`](https://www.npmjs.com/package/@ansugroup/isolate-shopify-api)

> Nodejs

By default, `@shopify/shopify-api` will use one variable: `Shopify` for APIs calling.

This package: `@ansugroup/isolate-shopify-api` will help if you want to connect to APIs on behalf of multiple apps/stores.

## Install

```bash
yarn add @ansugroup/isolate-shopify-api
```

## Usage

> Split Shopify API by app

```ts
import Shopify, { ApiVersion } from "@shopify/shopify-api";
import createIsolateShopify from "@ansugroup/isolate-shopify-api";

const shopifyApp1 = createIsolateShopify({
  // default config from Shopify example:
  API_KEY: process.env.SHOPIFY_API_KEY_APP_1,
  API_SECRET_KEY: process.env.SHOPIFY_API_SECRET_APP_1,
  SCOPES: process.env.SCOPES.split(","),
  HOST_NAME: process.env.HOST.replace(/https:\/\//, ""),
  API_VERSION: ApiVersion.October20,
  IS_EMBEDDED_APP: true,
  // This should be replaced with your preferred storage strategy
  SESSION_STORAGE: new Shopify.Session.MemorySessionStorage(),
});

// shopifyApp1.Clients.Rest ...

const shopifyApp2 = createIsolateShopify({
  API_KEY: process.env.SHOPIFY_API_KEY_APP_2,
  API_SECRET_KEY: process.env.SHOPIFY_API_SECRET_APP_2,
  SCOPES: process.env.SCOPES.split(","),
  HOST_NAME: process.env.HOST.replace(/https:\/\//, ""),
  API_VERSION: ApiVersion.October20,
  IS_EMBEDDED_APP: true,
  // This should be replaced with your preferred storage strategy
  SESSION_STORAGE: new Shopify.Session.MemorySessionStorage(),
});

// shopifyApp2.Clients.Rest ...
// not get the value or overwrite the value of shopifyApp1
```

## License

MIT

---
_Source: https://npm.io/package/@ansugroup/isolate-shopify-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
