Skip to content

About

Official Node.js SDK for JoonWeb API for Creating Apps for JoonWeb

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

@joonweb/api

A professional Node.js SDK for building applications on the Joonweb platform.

Installation

npm install @joonweb/api

Quick Start

1. Initialization

Initialize the global SDK context:

import { Context } from '@joonweb/api';

Context.init({
  apiKey: process.env.JOONWEB_CLIENT_ID,
  apiSecret: process.env.JOONWEB_CLIENT_SECRET,
  apiVersion: '26.0',
  appName: 'My Node App'
});

2. OAuth Authentication

import { OAuth } from '@joonweb/api';

const authUrl = OAuth.getAuthorizationUrl('example.myjoonweb.com', ['read_products', 'write_products'], 'https://yourapp.com/callback');
// Redirect user to authUrl...

// In your callback route:
const tokenData = await OAuth.exchangeCodeForToken('example.myjoonweb.com', req.query.code);

3. Making API Calls

import { JoonWebAPI } from '@joonweb/api';

const api = new JoonWebAPI('access_token_here', 'example.myjoonweb.com');

async function fetchProducts() {
  const products = await api.product.all({ limit: 10 });
  console.log(products);
}

About

Official Node.js SDK for JoonWeb API for Creating Apps for JoonWeb

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages