sharetribe-flex-integration-sdk

1.10.0 • Public • Published

Sharetribe Flex Integration SDK for JavaScript

Use Sharetribe Flex Integration API with ease.

CircleCI

Table of Contents

What is it?

The SDK is the easiest way to interact with Sharetribe Flex Integration API.

It handles groundwork such as authentication, renewing authentication tokens and serializing and deserializing data to and from JavaScript data structures.

This lets you to concentrate on building your integration instead of setting up the necessary boilerplate to communicate with the API.

Installation

Yarn:

yarn add sharetribe-flex-integration-sdk

Usage

const sharetribeIntegrationSdk = require('sharetribe-flex-integration-sdk');

// Create new SDK instance
const integrationSdk = sharetribeIntegrationSdk.createInstance({
  clientId: '<Your Client ID here>',
  clientSecret: '<Your Client secret here>'
});

// Query first 5 listings
integrationSdk.listings
  .query({ perPage: 5 })
  .then(res => {
    // Print listing titles
    res.data.data.forEach(listing => {
      console.log(`Listing: ${listing.attributes.title}`)
    });
  })
  .catch(res => {
    // An error occurred
    console.log(`Request failed with status: ${res.status} ${res.statusText}`);
  });

Client ID and client secret are required to create a new SDK instance. See this article to learn how to get them.

Examples

See the flex-integration-api-examples repository on GitHub.

Documentation

Documentation can be found here.

Changelog

See CHANGELOG.md.

License

Distributed under The Apache License, Version 2.0

Readme

Keywords

Package Sidebar

Install

npm i sharetribe-flex-integration-sdk

Weekly Downloads

841

Version

1.10.0

License

Apache-2.0

Unpacked Size

1.44 MB

Total Files

66

Last publish

Collaborators

  • sharetribe