New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

ccam-sdk

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ccam-sdk

Typed SDK for the Salesforce Commerce Cloud Account Manager REST API

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

ccam-sdk

Typed TypeScript SDK for the Salesforce Commerce Cloud Account Manager REST API.

The AM API is largely undocumented. ccam-sdk is a first-class, documented TypeScript library covering every AM resource: users, organizations, API clients, roles, realms, permissions, service types, org configurations, and instances. It powers the @j-256/ccam CLI but is also designed for direct use in your own tooling.

  • TSDoc on every method
  • Typed sort enums (no stringly-typed sort params)
  • Structured error taxonomy (CcamError, CcamAuthError, CcamNotFoundError)
  • Spring Data REST pagination, normalized
  • Token caching with optional disk persistence callbacks

Installation

npm install ccam-sdk

Requires Node.js 22 or later.

Usage

import { CcamClient } from 'ccam-sdk';

const client = new CcamClient({
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  host: 'https://account.demandware.com' // optional, this is the default
});

// List users with pagination
const result = await client.users.list({ page: 0, size: 25 });
console.log(result.content);
console.log(`Page ${result.page.number + 1} of ${result.page.totalPages}`);

// Get user by login with expanded organizations
const user = await client.users.getByLogin('user@example.com', {
  expand: 'organizations'
});

// List roles with sorting
const roles = await client.roles.list({
  page: 0,
  size: 50,
  sort: { field: 'name', direction: 'asc' }
});

Authentication

OAuth2 with four grant types: client_credentials, password, authorization_code (with PKCE), and refresh_token. Two contexts: client-only (system) or client + user (user-scoped). Token caching is built in; supply persistence callbacks if you want refresh tokens to survive process restarts.

Credentials can come from explicit constructor options or environment variables (CCAM_CLIENT_ID, CCAM_CLIENT_SECRET, CCAM_USER, CCAM_USER_PASSWORD, CCAM_HOST).

Resources

SDK propertyResource
client.usersUsers
client.organizationsOrganizations
client.apiClientsAPI Clients
client.rolesRoles
client.realmsRealms
client.permissionsPermissions
client.serviceTypesService Types

Most resources support paginated list, get(id), and resource-specific finders (findByOrg, findByRole, findByOrgAndRole, etc.). Users and API clients support full CRUD; organizations support update.

CLI

If you want a command-line tool instead of (or in addition to) the SDK, install @j-256/ccam:

npm install -g @j-256/ccam
ccam user list --org abc123 --format csv > users.csv

License

MIT

Keywords

salesforce

FAQs

Package last updated on 03 Sep 2026

Related posts