npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sfcc-users

v1.0.0

Published

A CLI tool for seamless AM and SFCC users creation/management

Downloads

26

Readme

SFCC Users Management CLI

Simple tool to quickly manage SFCC users in Account Manager and SFCC instances.

Do you need to provide access to SFCC instances frequently, but don't want to spend much time on AM authentication and clicking through its UI? Do you have non-default SFCC roles that you need to assign to users, but have to wait for their first login to the SFCC instance?

sfcc-users will do this manual work for you in several seconds, just give it emails of users you need to provide access to.

Features

  • Create AM users with defined roles and scopes
  • Create SFCC users with non-default roles
  • Process list of emails at once
  • More features to come!

Installation

Prerequesites

This tool uses sfcc-ci and its configuration to interact with SFCC instances (to manage users there).

It looks for valid dw.json config with fields needed for sfcc-ci - "client-id", "client-secret", "username", "password". Format is described in sfcc-ci guide

First-time installation

For the very first run, you need to generate configuration file. Run from the root of your project (the same level where dw.json is):

npx sfcc-users setup

You will be asked a few questions to generate configuration file for future use. You may want to commit the configuration file to let your teammates to skip the setup step.

You can create/modify generated configuration file manually if you need. Format is described in Configuration file section below.

Usage

Provide emails

You can provide emails by simply running the add command:

npx sfcc-users add

The tool will ask you to enter one or several emails (comma-separated).

Provide a file with emails

You can provide a file with emails (one per line):

Provide initial arguments

You can also specify list of emails or a file as an argument of add command to skip the first prompt:

npx sfcc-users add [email protected] [email protected]

# or

npx sfcc-users add users.txt

Configuration file

Configuration file is JavaScript file that is used by sfcc-users to identify where and how users should be managed.

Format (CommonJS config will be generated instead if you don't use "type": "module"):

import { createRequire } from 'module';

const DW_PATH = "./dw.json";
const require = createRequire(import.meta.url);
const dw = require(DW_PATH);

const configs = [
    {
        "orgName": "Northern Trail Outfitters",
        "realm": "abcd",
        "instances": [
            {
                "title": "abcd-001.dx.commercecloud.salesforce.com",
                "hostname": "abcd-001.dx.commercecloud.salesforce.com",
                "shortcode": "abcd_001",
            },
            {
                "title": "You can change title to anything",
                "hostname": "abcd-002.dx.commercecloud.salesforce.com",
                "shortcode": "abcd_002",
            },
            {
                "title": "UAT instance",
                "hostname": "development-us01-nto.demandware.net",
                "shortcode": "abcd_dev",
            },
            {
                "title": "Preview environment",
                "hostname": "staging-us01-nto.demandware.net",
                "shortcode": "abcd_stg",
            },
            {
                "title": "Production",
                "hostname": "production-us01-nto.demandware.net",
                "shortcode": "abcd_prd",
            },
        ],
        // AM roles to select from (only SFCC roles are supported)
        "roles": [
            "bm-user",
            "bm-admin",
        ],
        // Non-default SFCC instance roles that you may have
        "instanceRoles": ["Non_Admin"],
    },
];

export default configs.map((config) => ({ ...dw, ...config }));