Fluid Topics Public API
Convenient wrapper for Fluid Topics public APIs and models.
Installation
Using npm
npm install @fluid-topics/public-api
Using yarn
yarn add @fluid-topics/public-api
Using jsDelivr CDN
<script src="https://cdn.jsdelivr.net/npm/@fluid-topics/public-api/dist/fluidtopics.min.js"></script>
Using unpkg CDN
<script src="https://unpkg.com/@fluid-topics/public-api/dist/fluidtopics.min.js"></script>
Publish
Manual
- Update package.json version
- Build the public API
- Login with NPM Antidot password
npm login
mail is also present on passbolt - Release with
npm release
- Do not forget to commit the package.json
Examples
Typescript
import {
FluidTopicsApi,
FtMap
} from "@fluid-topics/public-api"
const api = new FluidTopicsApi("https://doc.fluidtopics.com", "my-ts-integration")
api.getMap("4R52zKZkt~kDZT3ZpoFNng")
.then((ftMap: FtMap) => console.log(ftMap))
Javascript
ESM/CommonJS:
const {FluidTopicsApi} = require("@fluid-topics/public-api")
const api = new FluidTopicsApi("https://doc.fluidtopics.com", "my-js-integration")
api.getMap("4R52zKZkt~kDZT3ZpoFNng")
.then(ftMap => console.log(ftMap))
UMD/Browser:
const {FluidTopicsApi} = window.fluidtopics
const api = new FluidTopicsApi("https://doc.fluidtopics.com", "my-js-integration")
api.getMap("4R52zKZkt~kDZT3ZpoFNng")
.then(ftMap => console.log(ftMap))
Result
{
title: 'Fluid Topics Release Notes v3.10',
lang: 'en-US',
id: '4R52zKZkt~kDZT3ZpoFNng',
originId: 'FT-3.10-public.ftmap',
baseId: 'FT-3.10-public.ftmap',
lastEdition: '2021-09-14',
lastPublication: '2021-09-14T10:29:12.308153',
clusterId: 'FT-3.10-public.ftmap',
editorialType: 'BOOK',
khubVersion: '3.10.12',
openMode: 'FLUIDTOPICS',
prettyUrl: '/go/FT/3.10/Release_Notes',
readerUrl: '/r/FT/3.10/Release_Notes',
rightsApiEndpoint: '/api/khub/maps/4R52zKZkt~kDZT3ZpoFNng/rights',
topicsApiEndpoint: '/api/khub/maps/4R52zKZkt~kDZT3ZpoFNng/topics',
attachmentsApiEndpoint: '/api/khub/maps/4R52zKZkt~kDZT3ZpoFNng/attachments',
metadata: [
{ key: 'Product', label: 'Product', values: [...] },
{ key: 'Version_FT', label: 'Version', values: [...] },
{ key: 'Category', label: 'Category', values: [...] },
{ key: 'audience', label: 'Audience', values: [...] },
{ key: 'FT_Version', label: 'Version', values: [...] }
]
}