@ucp-npm/sophtron-adapter
v2.0.1
Published
Sophtron Adapter for the Universal Connect Widget
Downloads
1,096
Keywords
Readme
Sophtron Adapter for the UCW
This is the adapter that makes it possible to connect with Sophtron via the Universal Connect Widget.
Installation
This package is meant to be used with the Universal Connect Widget. If you have forked the UCW project, you can install it as a dependency of the widget.
Navigate to your forked project and, from the root of the project, run:
npm i @ucp-npm/sophtron-adapter --workspace apps/server
Usage
Once you have the npm package installed, you can set up the ucw to use it.
In the ./apps/server/adapterSetup.ts
file, do the following:
Import getSophtronAdapterMapObject
from the Sophtron adapter package:
import { getSophtronAdapterMapObject } from "@ucp-npm/sophtron-adapter";
Import the logger:
import * as logger from "./infra/logger";
Next, look for the line that starts with export const adapterMap = {
, and add the adapter map as follows:
const sophtronAdapterMapObject = getSophtronAdapterMapObject({
logClient: logger,
aggregatorCredentials: {
clientId: config.SOPHTRON_API_USER_ID,
secret: config.SOPHTRON_API_USER_SECRET,
},
envConfig: {
HOSTURL: config.HOST_URL,
},
});
export const adapterMap = {
...sophtronAdapterMapObject,
...testAdapterMapObject,
};
The logClient
dependency is provided by the Universal Connect Widget.
Published NPM Package
https://www.npmjs.com/package/@ucp-npm/sophtron-adapter
More Info
See https://universalconnectproject.org/ for more information.