@zcollins-senneca/infor-cpq-provider
v1.0.3
Published
React Provider + Node.js CPQ proxy server for Infor CPQ APIs
Maintainers
Readme
@zcollins-senneca/infor-cpq-provider
React Provider + Node.js proxy server for Infor CPQ APIs.
This package handles CORS and OAuth token management automatically.
Installation
npm install @zcollins-senneca/infor-cpq-providerSetup
1. Environment Variables
Create a .env file:
ION_BASE_URL=https://your-infor-base-url
INFOR_TENANT=your-tenant
CPQ_BASE_URL=your-cpq-path
OAUTH_TOKEN_URL=https://your-oauth-server/connect/token
OAUTH_CLIENT_ID=your-client-id
OAUTH_CLIENT_SECRET=your-client-secret
OAUTH_USERNAME=your-username
OAUTH_PASSWORD=your-password⚠️ These values must never be exposed in your React client. They are only used by the proxy server.
2. Start the Proxy Server
import { startServer } from "@zcollins-senneca/infor-cpq-provider/server";
startServer({ port: 4000 });This launches an Express server that:
- Fetches and caches bearer tokens
- Refreshes tokens automatically before expiry
- Proxies requests to CPQ APIs without exposing secrets
3. Use the React Provider
import React from "react";
import { CPQProvider } from "@zcollins-senneca/infor-cpq-provider";
export function App() {
return (
<CPQProvider serverPort={4000}>
<YourComponents />
</CPQProvider>
);
}Proxy Endpoints
The proxy exposes these endpoints (behind token management):
POST /cpq/start→ Start a new configurationPOST /cpq/configure→ Update a configurationPOST /cpq/cancel→ Cancel configurationPOST /cpq/finalize→ Finalize configurationPOST /cpq/savePartial→ Save partialPOST /cpq/saveFull→ Save fullPOST /cpq/initialize→ Initialize session
Development
npm run dev # run locally
npm run build # build package
npm publish --access publicLicense
MIT © Zac Collins
