@liquiditeam/app-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Liquiditeam app-sdk

import initAppSDK from '@liquiditeam/app-sdk';
import cookieParser from 'cookie-parser';
import express, { Router } from 'express';

const config = {
  appBaseUrl: 'http://example.com', // the base url of the app
  appStoreAppName: 'example-app', // the name of the app in the app store
  appStoreGraphqlUrl: 'https://appstore.fan-platform.com',
  appStoreGraphqlWsUrl: 'wss://appstore.fan-platform.com',
  fanIdBaseUrl: 'https://me.fan',
  clientId: '123456', // of the fan id oauth app
  clientSecret: '987654', // of the fan id oauth app
};

const app = express();
const router = Router();
const sdk = initAppSDK(config);

// add routes to router

app.use(cookieParser());
app.use(sdk.middleware(router));

const main = async () => {
  await sdk.fetchInstallations(app.locals);

  sdk.subscribeToInstallationChanges(app.locals);

  app.listen(PORT, () => {
    console.log(`Listening on port ${PORT}`);
  });
};

main();

Readme

Keywords

none

Package Sidebar

Install

npm i @liquiditeam/app-sdk

Weekly Downloads

4

Version

0.1.3

License

MIT

Unpacked Size

98.2 kB

Total Files

36

Last publish

Collaborators

  • jisensee
  • jfritsch
  • roydigerhund
  • nigimaxx