Client Portal

Serve customers with the standalone portal template backed by Client Portal credentials. This guide follows version 3.1.7 (03acdf712c).

For portal authentication, see Authentication. For CMS reads, see CMS + Next.js.

App

apps/client-portal-template/ is a standalone Next.js 16 (React 19) starter, not an Nx project. Development port is 3800 (next dev --port 3800).

  • Apollo client: modules/apollo/apolloClient.ts points at ${ERXES_API_URL}/graphql with x-app-token: NEXT_PUBLIC_ERXES_CP_TOKEN.
  • Wrapper: modules/apollo/ApolloWrapper.tsx uses NEXT_PUBLIC_ERXES_API_URL/graphql.

Configure the Client Portal in erxes (enable the Content or related plugin, create the portal, copy its token), then set the website's private environment to the deployment's gateway URL and that portal token. Keep the token server-side; see the CMS Setup credential boundaries.

Verify

  1. Create a portal, a test post, and a draft; confirm only published content appears.
  2. Load the portal, sign in as a portal user where applicable, and exercise one mutation through its authorized endpoint.
  3. Confirm browser requests carry no Apps token.

Source references

Was this helpful?