Skip to main content

Getting started

Our Javascript SDK makes it easy to connect to our GraphQL API and includes all the required dependencies you need.

This library provides Typescript support and works both browser and NodeJS environments.

1. Install the SDK 🔧

The first thing you will need to do is add the SDK to your dependencies:

npm install abowire

2. Initiate the SDK and authenticate 🔐

There are multiple ways of authenticating your requests to Abowire.

  • Backend apps: You can provide your client credentials or specify your access token.
  • Frontend apps: You can generate a session token scoped to a user in the backend and pass it to the frontend.

If your connecting a backend application and have API Key pair, you can provide them to the SDK and it will authenticate your calls with them. The SDK authenticates you using the OAuth2 Client Credentials Grant.

info

You can create your backend client credentials by logging into Abowire and going to Settings > API Keys.

Go here see read more about our authentication flows.

import { Abowire } from "abowire";

const abowire = Abowire({
clientId: "<client-id>",
secret: "<your-secret>",
scope: "openid profile full_access",
});

4. Ready for take off 🚀

You're now ready to make authenticated calls 😎

5. Make a query 🔎

import { Abowire, gql } from "abowire";

const abowire = Abowire({...});

// Define your own GraphQL query
const CUSTOMER_LIST = gql`
query {
customers {
items {
id
email
}
}
}
`;

(async () => {
const customers = await abowire.query(CUSTOMER_LIST);

console.log(customers);
})()

Next steps: Learn more about our GraphQL API!

Learn more about our GraphQL API and what available fields and operations are in our API Reference.

You can use our interactive GraphQL Playground to try out all the possibilities.

info

You will need to authenticate your playground calls. To do this, send an Authorization HTTP header with your access token:

{
"authorization": "Bearer <your-access-token>"
}