@liquiditeam/app-sdk
v0.1.4
Published
```ts import initAppSDK from '@liquiditeam/app-sdk'; import cookieParser from 'cookie-parser'; import express, { Router } from 'express';
Downloads
11
Keywords
Readme
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();