1.0.0-beta.7 • Published 1 year ago
@amitechgrp/bigcommerce-api-sdk v1.0.0-beta.7
API SDK for BigCommerce
Using Management API
import { config, products } from '@amitechgrp/bigcommerce-api-sdk'
// setup configuration
config.set({
storeHash: 'storeHash',
apiClientId: 'clientId',
apiToken: 'apiToken',
})
// getting product name
const getProductName = async (id: number) => {
const product = await products.get(id)
return product?.name
}
Using Graphql
import { graphqlApi } from '@amitechgrp/bigcommerce-api-sdk'
// setup configuration
graphqlApi.config.set({
storeHash: 'storeHash',
bearerJWT: 'jwt token',
})
// run graphql query
const getRouteQuery = /* GraphQL */ `
query getRoute($urlPath: String!) {
site {
route(path: $urlPath) {
...
}
}
}
`
graphqlApi.client.request({
data: {
query: getStoreNameQuery,
variables: {
urlPath: '/category-url'
},
},
cookie: 'SHOP_TOKEN=123'
})
1.0.0-beta.6
1 year ago
1.0.0-beta.7
1 year ago
1.0.0-beta.5
1 year ago
1.0.0-beta.4
1 year ago
1.0.0-beta.3
1 year ago
1.0.0-beta.2
1 year ago