Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@backpackjs/client

Package Overview
Dependencies
Maintainers
11
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backpackjs/client

Pack client for interacting with the Pack GraphQL API

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
11
Weekly downloads
 
Created
Source

@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

FAQs

Package last updated on 11 Aug 2023

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc