@555platform/555-sdk-parser

555 Platform Message Parser

Usage no npm install needed!

<script type="module">
  import 555platform555SdkParser from 'https://cdn.skypack.dev/@555platform/555-sdk-parser';
</script>

README

Build

555 Platform Message Format and Chat Message Format Typescript Parser

All of the Platform Message Format functions reside in PMF namespace and Chat Message Format functions are in CMF namespace.

Install and Use

npm i @555platform/555parser.ts -S

import { PMF, CMF } from '@555platform/555parser.ts';

PMF Namespace Functions

  • pmfBuilder(options: EnvelopeOptions, payload: object) - builds PMF message with specified payload
  • pmfParser(message: Envelope) - returns payload object
  • pmfNamespace(message: Envelope) - returns namespace in PMF Envelope

PMF Types

EnvelopeOptions = {
  auth: string;
  namespace: string;
  tid?: string;
  logLevel?: PmfLogLevels;
  ttl?: number;
};
Envelope = {
  auth: string;
  mid: string;
  namespace: string;
  tid: string;
  logLevel: PmfLogLevels;
  ttl: number;
  version: string;
  timestamp: Date;
  body: Object;
};