Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sharetribe/flex-sdk-js
✨ Sharetribe Flex SDK for JavaScript ✨
https://github.com/sharetribe/flex-sdk-js
api sdk sharetribe
Last synced: 1 day ago
JSON representation
✨ Sharetribe Flex SDK for JavaScript ✨
- Host: GitHub
- URL: https://github.com/sharetribe/flex-sdk-js
- Owner: sharetribe
- License: apache-2.0
- Created: 2017-01-10T10:57:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-20T11:47:32.000Z (6 months ago)
- Last Synced: 2024-05-21T12:02:03.682Z (6 months ago)
- Topics: api, sdk, sharetribe
- Language: JavaScript
- Homepage: https://sharetribe.github.io/flex-sdk-js/
- Size: 13.5 MB
- Stars: 26
- Watchers: 12
- Forks: 19
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Sharetribe SDK for JavaScript
Use Sharetribe Marketplace API with ease.
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/sharetribe/flex-sdk-js/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/sharetribe/flex-sdk-js/tree/master)
## Table of Contents
* [What is it?](#what-is-it)
* [Installation](#installation)
* [Usage](#usage)
* [Examples](#examples)
* [Documentation](#documentation)
* [License](#license)## What is it?
The SDK is the **easiest** way to interact with Sharetribe Marketplace API
and Asset Delivery 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 marketplace
front-end** instead of setting up the necessary boilerplate to
communicate with the API.## Installation
Yarn:
```sh
yarn add sharetribe-flex-sdk
```## Usage
```js
const sharetribeSdk = require('sharetribe-flex-sdk');// Create new SDK instance
// To obtain a client ID, see Applications in Console
const sdk = sharetribeSdk.createInstance({
clientId: ''
});// Query first 5 listings
sdk.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 is required to create a new SDK instance.
See [this article](https://www.sharetribe.com/docs/background/applications/)
to learn how to create an application and get the client ID.## Examples
See [examples/](https://github.com/sharetribe/flex-sdk-js/tree/master/examples/) directory in Github repository.
## Documentation
[Documentation can be found here](https://sharetribe.github.io/flex-sdk-js/).
## Changelog
See [CHANGELOG.md](https://github.com/sharetribe/flex-sdk-js/tree/master/CHANGELOG.md).
## License
Distributed under [The Apache License, Version 2.0](https://github.com/sharetribe/flex-sdk-js/tree/master/LICENSE)