@alpaca-travel/graph-sdk-fetch
TypeScript icon, indicating that this package has built-in type declarations

2.1.5 • Public • Published

Alpaca Travel GraphQL SDK for fetch

npmnpm bundle sizeNPM

A basic fetch based SDK for use in the browser.

See More:

UNPKG CDN

You can use a hosted version of the SDK via unpkg.com which mirrors and hosts the release made to NPM.

Latest release

https://unpkg.com/@alpaca-travel/graph-sdk-fetch@latest/dist/umd/graph-sdk.min.js

Example pinned to version 2

You can also target a specific version in the URL, pinning the version following a semver style. This will ensure that breaking changes do not affect your implementation.

https://unpkg.com/@alpaca-travel/graph-sdk-fetch@2/dist/umd/graph-sdk.min.js

Example HTML

<!DOCTYPE html>
<html>
  <head>
    <!-- Include the script in your head -->
    <script src="https://unpkg.com/@alpaca-travel/graph-sdk-fetch@latest/dist/umd/graph-sdk.min.js"></script>
  </head>

  <body>
    <script type="text/javascript">
      // Update below
      const ACCESS_TOKEN = "UPDATE_WITH_YOUR_ACCESS_TOKEN";

      // Create the SDK
      const sdk = alpacaGraphSdk.getClientSdk({
        url: `https://withalpaca.com/api/graphql?accessToken=${ACCESS_TOKEN}`,
      });

      // Perform a SDK function
      // See the rest of the API Documentation
      // https://alpacatravel.github.io/graph-sdk/packages/fetch/docs/
      sdk
        .getItinerary({
          id: "itinerary/0mttpRn7spYNDIV979fHbE",
        })
        .then(({ data }) => console.log(data))
        .catch(console.error);
    </script>
  </body>
</html>

Readme

Keywords

none

Package Sidebar

Install

npm i @alpaca-travel/graph-sdk-fetch

Weekly Downloads

0

Version

2.1.5

License

MIT

Unpacked Size

803 kB

Total Files

8

Last publish

Collaborators

  • cammanderson