0.0.7 • Published 2 months ago

@pack/client v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

@pack/client

The @pack/client package provides a client for interacting with the Pack GraphQL API.

Installation

npm install @pack/client

Usage

The client needs to be configured with your store's token, which can be found in the Pack admin under Settings > Developer > API Keys.

import { PackClient } from '@pack/client';

const packClient = new PackClient({
  token: 'YOUR_TOKEN',
  contentEnvironment: 'production' 
});

const { data, error } = await packClient.fetch(QUERY, OPTIONS);
  • QUERY - The GraphQL query string
  • OPTIONS - Optional PackFetchOptions
    • variables - Object containing any GraphQL variables

Returns a promise resolving to:

  • data - The data returned by the GraphQL API
  • error - Any error that occurred, with additional info

Development

# install dependencies
yarn

# build package
yarn build

# test package
yarn test
0.1.0-ab-beta.0

2 months ago

0.0.7

5 months ago

0.0.6

6 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago